uranusjr commented on code in PR #29892:
URL: https://github.com/apache/airflow/pull/29892#discussion_r1129841395


##########
airflow/cli/commands/connection_command.py:
##########
@@ -325,3 +325,23 @@ def _import_helper(file_path: str, overwrite: bool) -> 
None:
             session.merge(conn)
             session.commit()
             print(f"Imported connection {conn_id}")
+
+
+@suppress_logs_and_warning
+def connections_test(args) -> None:
+    """Test an Airflow connection."""
+    console = AirflowConsole()
+
+    try:
+        print(f"Retrieving connection: {args.conn_id!r}")
+        conn = BaseHook.get_connection(args.conn_id)
+    except AirflowNotFoundException:
+        console.print("[bold yellow]\nConnection not found.\n")
+        raise SystemExit()

Review Comment:
   This should be `sys.exit()` _with a non-zero return code_.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to