Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
itminedu
synnefo
Commits
126e0938
Commit
126e0938
authored
Feb 12, 2014
by
Ilias Tsitsimpis
Committed by
Giorgos Korfiatis
Feb 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snf-ci: Add 'shell' command
parent
c0649302
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
ci/snf-ci
ci/snf-ci
+8
-2
ci/utils.py
ci/utils.py
+6
-0
No files found.
ci/snf-ci
View file @
126e0938
...
...
@@ -18,6 +18,7 @@ DEPLOY_SYNNEFO_CMD = "deploy"
TEST_SYNNEFO_CMD
=
"test"
RUN_BURNIN_CMD
=
"burnin"
CREATE_X2GO_FILE
=
"x2goplugin"
SHELL_CONNECT
=
"shell"
ALL_CMDS
=
"all"
COMMANDS_IN_ALL_MODE
=
[
...
...
@@ -32,6 +33,7 @@ COMMANDS_IN_ALL_MODE = [
AVAILABLE_COMMANDS
=
[
CREATE_X2GO_FILE
,
DELETE_SERVER_CMD
,
SHELL_CONNECT
,
]
+
COMMANDS_IN_ALL_MODE
USAGE
=
"""usage: %%prog [options] command[,command...]
...
...
@@ -45,6 +47,7 @@ command:
* %s: Run snf-burnin in the deployed Synnefo
* %s: Create x2go plugin file
* %s: Delete the slave server
* %s: Connect to the server using ssh
* %s: Run all the available commands
"""
%
tuple
([
CREATE_SERVER_CMD
,
...
...
@@ -55,10 +58,11 @@ command:
RUN_BURNIN_CMD
,
CREATE_X2GO_FILE
,
DELETE_SERVER_CMD
,
SHELL_CONNECT
,
ALL_CMDS
])
def
main
():
#
Too many branches. pylint: disable-msg=R0912
def
main
():
#
pylint: disable=too-many-statements, too-many-branches
"""Parse command line options and run the specified actions"""
parser
=
OptionParser
(
usage
=
USAGE
)
parser
.
add_option
(
"-c"
,
"--conf"
,
dest
=
"config_file"
,
default
=
None
,
...
...
@@ -79,7 +83,7 @@ def main(): # Too many branches. pylint: disable-msg=R0912
help
=
"Upload/Install the public ssh keys contained"
" in this file to the server"
)
parser
.
add_option
(
"--name"
,
dest
=
"server_name"
,
default
=
None
,
help
=
""
)
,
help
=
""
)
parser
.
add_option
(
"-n"
,
"--build-id"
,
dest
=
"build_id"
,
default
=
None
,
type
=
"int"
,
help
=
"Specify a number to use to identify this build."
...
...
@@ -172,6 +176,8 @@ def main(): # Too many branches. pylint: disable-msg=R0912
synnefo_ci
.
x2go_plugin
(
options
.
x2go_output
)
if
getattr
(
options
,
DELETE_SERVER_CMD
,
False
):
synnefo_ci
.
destroy_server
()
if
getattr
(
options
,
SHELL_CONNECT
,
False
):
synnefo_ci
.
shell_connect
()
if
__name__
==
"__main__"
:
...
...
ci/utils.py
View file @
126e0938
...
...
@@ -261,6 +261,12 @@ class SynnefoCI(object):
fip
[
'floating_ip_address'
])
self
.
network_client
.
delete_floatingip
(
fip
[
'id'
])
# pylint: disable= no-self-use
@
_check_fabric
def
shell_connect
(
self
):
"""Open shell to remote server"""
fabric
.
open_shell
(
"export TERM=xterm"
)
def
_create_floating_ip
(
self
):
"""Create a new floating ip"""
networks
=
self
.
network_client
.
list_networks
(
detail
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment