Commit 09ac9d1f authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

ci: Allow multiple commands in snf-ci script

Allow snf-ci script to accept a comma seperated list of commands to run.
parent 85c669ae
...@@ -27,7 +27,7 @@ AVAILABLE_COMMANDS = [ ...@@ -27,7 +27,7 @@ AVAILABLE_COMMANDS = [
RUN_BURNIN_CMD, RUN_BURNIN_CMD,
] ]
USAGE = """usage: %%prog [options] command USAGE = """usage: %%prog [options] command[,command...]
command: command:
* %s: Create the slave server * %s: Create the slave server
...@@ -100,18 +100,22 @@ def main(): # Too many branches. pylint: disable-msg=R0912 ...@@ -100,18 +100,22 @@ def main(): # Too many branches. pylint: disable-msg=R0912
print msg print msg
return return
command = args[0] commands = args[0]
if command == ALL_CMDS: if commands == ALL_CMDS:
for cmd in AVAILABLE_COMMANDS: for cmd in AVAILABLE_COMMANDS:
setattr(options, cmd, True) setattr(options, cmd, True)
elif command not in AVAILABLE_COMMANDS:
msg = "ERROR: Unknown command: %s" % command
parser.print_help()
print
print msg
return
else: else:
setattr(options, command, True) commands = commands.split(",")
for command in commands:
if command not in AVAILABLE_COMMANDS:
msg = "ERROR: Unknown command: %s" % command
parser.print_help()
print
print msg
return
else:
setattr(options, command, True)
synnefo_ci = SynnefoCI(config_file=options.config_file, synnefo_ci = SynnefoCI(config_file=options.config_file,
build_id=options.build_id, build_id=options.build_id,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment