Skip to content

Commit

Permalink
dropped '--delete' option from upload cli
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Jun 17, 2024
1 parent cfe9629 commit 3ce6a35
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions xnat_ingest/cli/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 3ce6a35

Please sign in to comment.