ashb commented on a change in pull request #12095:
URL: https://github.com/apache/airflow/pull/12095#discussion_r526967986



##########
File path: airflow/cli/commands/pool_command.py
##########
@@ -63,13 +64,14 @@ def pool_delete(args):
 @cli_utils.action_logging
 def pool_import(args):
     """Imports pools from the file"""
-    api_client = get_current_api_client()
-    if os.path.exists(args.file):
-        pools = pool_import_helper(args.file)
-    else:
+    if not os.path.exists(args.file):
         print("Missing pools file.")
-        pools = api_client.get_pools()
+        sys.exit(1)
+    pools, failed = pool_import_helper(args.file)
     print(_tabulate_pools(pools=pools, tablefmt=args.output))
+    if len(failed) > 0:
+        print("Failed to update pool(s): {}".format(", ".join(failed)))
+        sys.exit(1)

Review comment:
       ```suggestion
           exit("Failed to update pool(s): {}".format(", ".join(failed)))
   ```
   
   This way the error goes to stderr, not stdout




----------------------------------------------------------------
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.

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


Reply via email to