18 |
18 |
TEST_SYNNEFO_CMD = "test"
|
19 |
19 |
RUN_BURNIN_CMD = "burnin"
|
20 |
20 |
CREATE_X2GO_FILE = "x2goplugin"
|
|
21 |
SHELL_CONNECT = "shell"
|
21 |
22 |
ALL_CMDS = "all"
|
22 |
23 |
|
23 |
24 |
COMMANDS_IN_ALL_MODE = [
|
... | ... | |
32 |
33 |
AVAILABLE_COMMANDS = [
|
33 |
34 |
CREATE_X2GO_FILE,
|
34 |
35 |
DELETE_SERVER_CMD,
|
|
36 |
SHELL_CONNECT,
|
35 |
37 |
] + COMMANDS_IN_ALL_MODE
|
36 |
38 |
|
37 |
39 |
USAGE = """usage: %%prog [options] command[,command...]
|
... | ... | |
45 |
47 |
* %s: Run snf-burnin in the deployed Synnefo
|
46 |
48 |
* %s: Create x2go plugin file
|
47 |
49 |
* %s: Delete the slave server
|
|
50 |
* %s: Connect to the server using ssh
|
48 |
51 |
|
49 |
52 |
* %s: Run all the available commands
|
50 |
53 |
""" % tuple([CREATE_SERVER_CMD,
|
... | ... | |
55 |
58 |
RUN_BURNIN_CMD,
|
56 |
59 |
CREATE_X2GO_FILE,
|
57 |
60 |
DELETE_SERVER_CMD,
|
|
61 |
SHELL_CONNECT,
|
58 |
62 |
ALL_CMDS])
|
59 |
63 |
|
60 |
64 |
|
61 |
|
def main(): # Too many branches. pylint: disable-msg=R0912
|
|
65 |
def main(): # pylint: disable=too-many-statements, too-many-branches
|
62 |
66 |
"""Parse command line options and run the specified actions"""
|
63 |
67 |
parser = OptionParser(usage=USAGE)
|
64 |
68 |
parser.add_option("-c", "--conf", dest="config_file", default=None,
|
... | ... | |
79 |
83 |
help="Upload/Install the public ssh keys contained"
|
80 |
84 |
" in this file to the server")
|
81 |
85 |
parser.add_option("--name", dest="server_name", default=None,
|
82 |
|
help=""),
|
|
86 |
help="")
|
83 |
87 |
parser.add_option("-n", "--build-id", dest="build_id", default=None,
|
84 |
88 |
type="int",
|
85 |
89 |
help="Specify a number to use to identify this build."
|
... | ... | |
172 |
176 |
synnefo_ci.x2go_plugin(options.x2go_output)
|
173 |
177 |
if getattr(options, DELETE_SERVER_CMD, False):
|
174 |
178 |
synnefo_ci.destroy_server()
|
|
179 |
if getattr(options, SHELL_CONNECT, False):
|
|
180 |
synnefo_ci.shell_connect()
|
175 |
181 |
|
176 |
182 |
|
177 |
183 |
if __name__ == "__main__":
|