[Projects] Return parameters for a command (#6409)

This commit is contained in:
Philipp Moritz 2019-12-10 10:25:01 -08:00 committed by GitHub
parent 6272907a57
commit 16be483af7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -270,10 +270,11 @@ def get_session_runs(name, command, parsed_args):
List of sessions to start, which are dictionaries with keys:
"name": Name of the session to start,
"command": Command to run after starting the session,
"params": Parameters for this run,
"num_steps": 4 if a command should be run, 3 if not.
"""
if not command:
return [{"name": name, "command": None, "num_steps": 3}]
return [{"name": name, "command": None, "params": {}, "num_steps": 3}]
# Try to find a wildcard argument (i.e. one that has a list of values)
# and give an error if there is more than one (currently unsupported).
@ -290,6 +291,7 @@ def get_session_runs(name, command, parsed_args):
session_run = {
"name": name,
"command": format_command(command, parsed_args),
"params": parsed_args,
"num_steps": 4
}
return [session_run]
@ -301,6 +303,7 @@ def get_session_runs(name, command, parsed_args):
session_run = {
"name": "{}-{}-{}".format(name, wildcard_arg, val),
"command": format_command(command, parsed_args),
"params": parsed_args,
"num_steps": 4
}
session_runs.append(session_run)