in remote_settings/subcommands/create.py [0:0]
def do_create(args):
"""Creates a new record based on args, and uploads it to Remote Settings.
Args:
args (argparse.Namespace): The arguments passed to the create subcommand
"""
client = RemoteSettingsClient.init_for_create(args)
print_info(args)
print_info(args, f"User: {client.authenticated_user()}")
print_info(args, f"Server: {client.server_url()}")
if client.record_count() == 0:
print_error("No records found.")
print_help("You may need to unzip the archives in the desired directory.")
exit(1)
print_info(args)
for i in range(client.record_count()):
print_info(args, f"Record: {client.record_info_json(i)}")
if not (args.dry_run or args.mock_connection):
print_info(args, "Creating record...")
client.create_new_record(i)
print_info(args, f"{client.attachment_name(i)} created")
print_info(args)
print_info(args)