summaryrefslogtreecommitdiffstats
path: root/docker_upgrade_scripts/fabfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'docker_upgrade_scripts/fabfile.py')
-rwxr-xr-xdocker_upgrade_scripts/fabfile.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/docker_upgrade_scripts/fabfile.py b/docker_upgrade_scripts/fabfile.py
new file mode 100755
index 00000000..72e3e61a
--- /dev/null
+++ b/docker_upgrade_scripts/fabfile.py
@@ -0,0 +1,32 @@
+from fabric.api import *
+from fabric.context_managers import *
+
+def uptime():
+ res = run('cat /proc/uptime')
+ print res
+
+def host_type():
+ run('uname -s')
+
+def upgrade_docker(server_name, my_env):
+ server_name=server_name.split("-")[1]
+ if server_name in "message-router":
+ execute_file = "/opt/mr_vm_init.sh"
+ elif server_name in "dcae-controller":
+ execute_file = "/opt/dcae2_vm_init.sh"
+ elif server_name in "openo-server":
+ execute_file = "/opt/openo_all_serv.sh"
+ elif server_name in "dns":
+ execute_file = None
+ else:
+ execute_file = "/opt/" + server_name + "_vm_init.sh"
+ print "Executing file %s" % execute_file
+ if execute_file:
+ with settings( warn_only=True, key_filename=my_env['key_filename'], user=my_env['user']):
+ sudo(execute_file)
+
+def health_checks_robot(my_env):
+ with settings( warn_only=True, key_filename=my_env['key_filename'], user=my_env['user']):
+ with cd('/opt'):
+ sudo('./ete.sh health')
+