From a9ef9b71c5c95ecb8c2aa10ebd84a8535d570dac Mon Sep 17 00:00:00 2001 From: Brianna Smart Date: Wed, 21 Aug 2024 16:53:59 -0700 Subject: [PATCH] Update function names --- .../lsst/alert/packet/bin/syncAllSchemasToRegistry.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/lsst/alert/packet/bin/syncAllSchemasToRegistry.py b/python/lsst/alert/packet/bin/syncAllSchemasToRegistry.py index 6b75eb6..938e1d6 100644 --- a/python/lsst/alert/packet/bin/syncAllSchemasToRegistry.py +++ b/python/lsst/alert/packet/bin/syncAllSchemasToRegistry.py @@ -46,7 +46,7 @@ def parse_args(): return parser.parse_args() -def upload_schema(registry_url, subject, schema_registry): +def upload_schemas(registry_url, subject, schema_registry): """Parse schema registry and upload all schemas. """ for schema_id in schema_registry.known_ids: @@ -65,8 +65,8 @@ def upload_schema(registry_url, subject, schema_registry): print(f"response text={response.text}") -def delete_schema(registry_url, subject): - """Delete schema and then remake it in import mode""" +def clear_schema_registry_for_import(registry_url, subject): + """Delete schemas in the registry and then remake it in import mode""" # Define the URLs url_mode = f"{registry_url}/mode/{subject}" url_schemas = f"{registry_url}/subjects/{subject}" @@ -122,9 +122,9 @@ def close_schema(registry_url, subject): def main(): args = parse_args() - delete_schema(args.schema_registry_url, args.subject) + clear_schema_registry_for_import(args.schema_registry_url, args.subject) schema_registry = lsst.alert.packet.schemaRegistry.SchemaRegistry().all_schemas_from_filesystem() - upload_schema( + upload_schemas( args.schema_registry_url, subject=args.subject, schema_registry=schema_registry