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

Method waitForHost

tools/marvin/marvin/deployDataCenter.py:233–253  ·  view source on GitHub ↗

Wait for the hosts in the zoneid, clusterid to be up 2 retries with 30s delay

(self, zoneId, clusterId)

Source from the content-addressed store, hash-verified

231 self.__cleanAndExit()
232
233 def waitForHost(self, zoneId, clusterId):
234 """
235 Wait for the hosts in the zoneid, clusterid to be up
236 2 retries with 30s delay
237 """
238 try:
239 retry, timeout = 2, 30
240 cmd = listHosts.listHostsCmd()
241 cmd.clusterid, cmd.zoneid = clusterId, zoneId
242 hosts = self.__apiClient.listHosts(cmd)
243 while retry != 0:
244 for host in hosts:
245 if host.state != 'Up':
246 break
247 sleep(timeout)
248 retry = retry - 1
249 except Exception as e:
250 print("\nException Occurred:%s" %\
251 GetDetailExceptionInfo(e))
252 self.__tcRunLogger.exception("=== List Hosts Failed===")
253 self.__cleanAndExit()
254
255 def createPrimaryStorages(self,
256 primaryStorages,

Callers 1

createClustersMethod · 0.95

Calls 3

__cleanAndExitMethod · 0.95
GetDetailExceptionInfoFunction · 0.90
listHostsMethod · 0.65

Tested by

no test coverage detected