def NodeDriver_wait_until_running(self, node, wait_period=3, timeout=600,
                                  ssh_interface='public_ips', force_ipv4=True):
    start = time.time()
    end = start + timeout

    def is_supported(address):
        """Return True for supported address"""
        if force_ipv4 and not len(address.split('.')) == 4:
            return False
        return True

    def filter_addresses(addresses):
        """Return list of supported addresses"""
        return [a for a in addresses if is_supported(a)]

    while time.time() < end:
        nodes = [n for n in self.list_nodes() if n.uuid == node.uuid]

        if len(nodes) > 1:
            raise LibcloudError(value=('Booted single node[%s], ' % node
                                + 'but multiple nodes have same UUID'),
                                driver=self)
        if len(nodes) == 1:
            print nodes[0].state, getattr(nodes[0], ssh_interface)

        if len(nodes) == 1 and filter_addresses(getattr(nodes[0], ssh_interface)) \
                and nodes[0].state == NodeState.RUNNING:
            return nodes[0], filter_addresses(getattr(nodes[0], ssh_interface))
        else:
            time.sleep(wait_period)
            continue

    raise LibcloudError(value='Timed out after %s seconds' % (timeout),
                        driver=self)
Block until node is fully booted and has an IP address assigned.
dataset/ETHPy150Open quaddra/provision/provision/patches.py/NodeDriver_wait_until_running