MCPcopy Create free account
hub / github.com/apache/cloudstack / restart_mgmt_server

Function restart_mgmt_server

tools/marvin/marvin/lib/utils.py:84–103  ·  view source on GitHub ↗

Restarts the management server

(server)

Source from the content-addressed store, hash-verified

82 return res
83
84def restart_mgmt_server(server):
85 """Restarts the management server"""
86
87 try:
88 # Get the SSH client
89 ssh = is_server_ssh_ready(
90 server["ipaddress"],
91 server["port"],
92 server["username"],
93 server["password"],
94 )
95 result = ssh.execute("/etc/init.d/cloud-management restart")
96 res = str(result)
97 # Server Stop - OK
98 # Server Start - OK
99 if res.count("OK") != 2:
100 raise ("ErrorInReboot!")
101 except Exception as e:
102 raise e
103 return
104
105
106def fetch_latest_mail(services, from_mail):

Callers

nothing calls this directly

Calls 3

countMethod · 0.80
is_server_ssh_readyFunction · 0.70
executeMethod · 0.65

Tested by

no test coverage detected