From 3ce6a3592deb9b676ed1bc79861be20ecf7848e8 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Mon, 17 Jun 2024 15:32:26 +1000 Subject: [PATCH] dropped '--delete' option from upload cli --- xnat_ingest/cli/upload.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/xnat_ingest/cli/upload.py b/xnat_ingest/cli/upload.py index 689035b..852f92a 100644 --- a/xnat_ingest/cli/upload.py +++ b/xnat_ingest/cli/upload.py @@ -48,12 +48,6 @@ @click.argument("server", type=str, envvar="XNAT_INGEST_UPLOAD_HOST") @click.argument("user", type=str, envvar="XNAT_INGEST_UPLOAD_USER") @click.option("--password", default=None, type=str, envvar="XNAT_INGEST_UPLOAD_PASS") -@click.option( - "--delete/--dont-delete", - default=True, - envvar="XNAT_INGEST_UPLOAD_DELETE", - help="Whether to delete the session directories after they have been uploaded or not", -) @click.option( "--log-level", default="info", @@ -166,7 +160,6 @@ def upload( server: str, user: str, password: str, - delete: bool, log_level: str, log_files: ty.List[LogFile], log_emails: ty.List[LogEmail], @@ -458,16 +451,7 @@ def iter_staged_sessions(): xnat_repo.connection.put( f"/data/experiments/{xsession.id}?triggerPipelines=true" ) - msg = f"Succesfully uploaded all files in '{session.name}'" - if delete: - msg += ", deleting originals..." - logger.info(msg) - if delete: - shutil.rmtree(session_staging_dir) - logger.info( - f"Deleted staging dir '{str(session_staging_dir)}' session data " - "after successful upload" - ) + logger.info(f"Succesfully uploaded all files in '{session.name}'") except Exception as e: if not raise_errors: logger.error(