diff options
author | 2017-10-12 20:50:46 +0000 | |
---|---|---|
committer | 2017-10-12 20:50:46 +0000 | |
commit | 2be47c1f61a633b4fd08f4ecb2bbbdd39a08eed6 (patch) | |
tree | 290b47a997422f4e039356a9bf2e86bcd9822afa /docker_upgrade_scripts/fabfile.py | |
parent | 005b9f8c91c3e2f2a01b2d605a325968e42d5205 (diff) | |
parent | 905b71b4fc72c7c091d9bd3dd616b951c75556fa (diff) |
Merge "Initial scripts to upgrade docker ONAP component"
Diffstat (limited to 'docker_upgrade_scripts/fabfile.py')
-rwxr-xr-x | docker_upgrade_scripts/fabfile.py | 32 |
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') + |