'Tight loop, waiting for the given server port(s) to be available.
Returns when all are pingable. There is a timeout on waiting
for the servers to come up.
:param servers: Glance server ports to ping
:param expect_launch: Optional, true iff the server(s) are
expected to successfully start
:param timeout: Optional, defaults to 30 seconds
:returns: None if launch expectation is met, otherwise an
assertion message'

def wait_for_servers(self, servers, expect_launch=True, timeout=30):

    now = datetime.datetime.now()
    timeout_time = (now + datetime.timedelta(seconds=timeout))
    replied = []
    while (timeout_time > now):
        pinged = 0
        for server in servers:
            if self.ping_server(server.bind_port):
                pinged += 1
                if (server not in replied):
                    replied.append(server)
        if (pinged == len(servers)):
            msg = 'Unexpected    server    launch    status'
            return (None if expect_launch else msg)
        now = datetime.datetime.now()
        time.sleep(0.05)
    failed = list((set(servers) - set(replied)))
    msg = 'Unexpected    server    launch    status    for:    '
    for f in failed:
        msg += ('%s,    ' % f.server_name)
        if os.path.exists(f.pid_file):
            pid = f.process_pid
            trace = f.pid_file.replace('.pid', '.trace')
            if self.tracecmd:
                cmd = ('%s    -p    %d    -o    %s' % (self.tracecmd, pid, trace))
                try:
                    execute(cmd, raise_error=False, expect_exit=False)
                except OSError as e:
                    if (e.errno == errno.ENOENT):
                        raise RuntimeError(('No    executable    found    for    "%s"    command.' % self.tracecmd))
                    else:
                        raise
                time.sleep(0.5)
                if os.path.exists(trace):
                    msg += ('\n%s:\n%s\n' % (self.tracecmd, open(trace).read()))
    self.add_log_details(failed)
    return (msg if expect_launch else None)
