Skip to content

Commit

Permalink
added 'method' option to upload script to pass through to XNATPy. can…
Browse files Browse the repository at this point in the history
… be used to avoid compressing directory uploads if uploading from a FS local to the XNAT instance
  • Loading branch information
tclose committed Jul 8, 2024
1 parent a53df7b commit 167545b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion xnat_ingest/cli/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,17 @@
"cluster and targeting the XNAT Tomcat directly"
),
)
@click.option(
"--method",
type=click.Choice(["per_file", "tar_memory", "tgz_memory", "tar_file", "tgz_file"]),
default="tgz_file",
envvar="XNAT_INGEST_UPLOAD_METHOD",
help=(
"The method to use to upload the files to XNAT. Passed through to XNATPy and controls "
"whether directories are tarred and/or gzipped before they are uploaded, by default "
"'tgz_file' is used"
),
)
def upload(
staged: str,
server: str,
Expand All @@ -199,6 +210,7 @@ def upload(
clean_up_older_than: int,
verify_ssl: bool,
use_curl_jsession: bool,
method: str,
):

set_logger_handling(
Expand Down Expand Up @@ -476,7 +488,7 @@ def iter_staged_sessions():
for fspath in scan.fspaths:
xresource.upload(str(fspath), fspath.name)
else:
xresource.upload_dir(scan.parent)
xresource.upload_dir(scan.parent, method=method)
logger.debug("retrieving checksums for %s", xresource)
remote_checksums = get_checksums(xresource)
logger.debug("calculating checksums for %s", xresource)
Expand Down

0 comments on commit 167545b

Please sign in to comment.