Fix pipeline from CLI with no args

This commit is contained in:
clearml 2025-05-06 11:38:09 +03:00
parent eb27fad4dc
commit c9533d814a

View File

@ -235,7 +235,7 @@ def cli() -> None:
print("Detected shell script. Binary will be set to '/bin/bash'") print("Detected shell script. Binary will be set to '/bin/bash'")
if args.pipeline: if args.pipeline:
argparse_args = [] argparse_args = []
for arg in args.args: for arg in (args.args or []):
arg_split = arg.split("=") arg_split = arg.split("=")
if len(arg_split) != 2: if len(arg_split) != 2:
raise ValueError("Invalid argument: {}. Format should be key=value".format(arg)) raise ValueError("Invalid argument: {}. Format should be key=value".format(arg))
@ -257,7 +257,7 @@ def cli() -> None:
version=args.pipeline_version, version=args.pipeline_version,
add_run_number=False if args.pipeline_dont_add_run_number else True, add_run_number=False if args.pipeline_dont_add_run_number else True,
binary=args.binary, binary=args.binary,
argparse_args=argparse_args argparse_args=argparse_args or None
) )
created_task = pipeline._task created_task = pipeline._task
else: else: