Skip to content

Commit

Permalink
Catch supported transfer protocols in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Jan 2, 2025
1 parent 02ca3f4 commit 53d0fc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion mars-cli/mars_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ def cli(ctx, development):
@click.option("--submit-to-ena", type=click.BOOL, default=True, help="Submit to ENA.")
@click.option(
"--file-transfer",
type=click.STRING,
type=click.Choice(["ftp", "aspera"], case_sensitive=False),
required=True,
help="provide the name of a file transfer solution, like ftp or aspera",
)
@click.option(
Expand Down
3 changes: 0 additions & 3 deletions mars-cli/mars_lib/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,8 @@ def upload_to_ena(
submission_url: str,
file_transfer: str,
):
ALLOWED_FILE_TRANSFER_SOLUTIONS = {"ftp", "aspera"}
file_transfer = file_transfer.lower()

if file_transfer not in ALLOWED_FILE_TRANSFER_SOLUTIONS:
raise ValueError(f"Unsupported transfer protocol: {file_transfer}")
if file_transfer == "ftp":
uploader = FTPUploader(
submission_url,
Expand Down

0 comments on commit 53d0fc1

Please sign in to comment.