utkarsharma2 commented on a change in pull request #9907:
URL: https://github.com/apache/airflow/pull/9907#discussion_r479669447
##########
File path: airflow/cli/commands/connection_command.py
##########
@@ -250,3 +259,77 @@ def connections_delete(args):
msg = '\n\tSuccessfully deleted `conn_id`={conn_id}\n'
msg = msg.format(conn_id=deleted_conn_id)
print(msg)
+
+
+DIS_RESTRICT = 'restrict'
+DIS_OVERWRITE = 'overwrite'
+DIS_IGNORE = 'ignore'
+CREATED = 'created'
+DISPOSITIONS = [DIS_RESTRICT, DIS_OVERWRITE, DIS_IGNORE]
+
+
+def _prep_import_status_msgs(conn_status_map):
+ """Prepare import connection status messages"""
+
+ msg = "\n"
+ for status, conn_list in conn_status_map.items():
+ if len(conn_list) == 0:
+ continue
+
+ msg = msg + status + " : \n\t"
+ for conn in conn_list:
+ msg = msg + '\n\t`conn_id`={conn_id} : {uri}\n'
+ msg = _prep_msg(msg, conn)
+ return msg
+
+
+@cli_utils.action_logging
+def connections_import(args):
+ """Import new connections"""
+
+ try:
+ conns_map = load_connections(args.file)
+ except AirflowException as e:
+ print(e)
+ return
Review comment:
done, updated function.
----------------------------------------------------------------
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]