From 03106c44504789dfcc3a11dba196370c37c474d8 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Mon, 23 Sep 2024 05:50:21 -0400 Subject: [PATCH] add centre-id root directory to zipfile --- wis2-gdc-management/wis2_gdc/archive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wis2-gdc-management/wis2_gdc/archive.py b/wis2-gdc-management/wis2_gdc/archive.py index e0440d0..c1c0f65 100644 --- a/wis2-gdc-management/wis2_gdc/archive.py +++ b/wis2-gdc-management/wis2_gdc/archive.py @@ -77,7 +77,7 @@ def _get_next_link(links) -> Union[str, None]: for feature in response['features']: LOGGER.debug(f"Saving {feature['id']} to archive") - filename = f"{feature['id']}.json" + filename = f"{CENTRE_ID}/{feature['id']}.json" zf.writestr(filename, json.dumps(feature)) if _get_next_link(response['links']) is None: @@ -100,5 +100,5 @@ def _get_next_link(links) -> Union[str, None]: def archive(ctx, archive_zipfile, verbosity='NOTSET'): """Archive discovery metadata records""" - click.echo(f'Archiving metadata from GDC {API_URL}') + click.echo(f'Archiving metadata from GDC {API_URL} to {archive_zipfile}') archive_metadata(archive_zipfile)