Wait for the hosts in the zoneid, clusterid to be up 2 retries with 30s delay
(self, zoneId, clusterId)
| 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, |
no test coverage detected