| 140 | |
| 141 | |
| 142 | def wait_for_up(cluster, node): |
| 143 | tries = 0 |
| 144 | addr = IP_FORMAT % node |
| 145 | while tries < 100: |
| 146 | host = cluster.metadata.get_host(addr) |
| 147 | if host and host.is_up: |
| 148 | wait_for_node_socket(get_node(node), 60) |
| 149 | log.debug("Done waiting for node %s to be up", node) |
| 150 | return |
| 151 | else: |
| 152 | log.debug("Host {} is still marked down, waiting".format(addr)) |
| 153 | tries += 1 |
| 154 | time.sleep(1) |
| 155 | |
| 156 | # todo: don't mix string interpolation methods in the same package |
| 157 | raise RuntimeError("Host {0} is not up after {1} attempts".format(addr, tries)) |
| 158 | |
| 159 | |
| 160 | def wait_for_down(cluster, node): |