def waitUntilPortIsAvailable(looper, ports, timeout=5):
    ports = itertools.chain(*ports)

    def chk():
        for port in ports:
            checkPortAvailable(('', port))
    looper.run(eventually(chk, retryWait=0.5, timeout=timeout))
def waitUntilPortIsAvailable(looper, ports, timeout=5):
    ports = itertools.chain(*ports)

    def chk():
        for port in ports:
            checkPortAvailable((, port))
    looper.run(eventually(chk, retryWait=0.5, timeout=timeout))