Пример #1
0
def wait_to_come_online(drive, timeout=120):
    while timeout >= 0:
        if is_tape_drive_online(drive):
            return

        time.sleep(1)
        timeout -= 1

    raise RobotMountTimeoutException()
Пример #2
0
def wait_to_come_online(drive, timeout=120):
    logger.debug('Waiting for {drive} to come online'.format(drive=drive))
    while timeout >= 0:
        if is_tape_drive_online(drive):
            return

        time.sleep(1)
        timeout -= 1

    logger.error('{drive} did not come online after {timeout} seconds'.format(drive=drive, timeout=120))
    raise RobotMountTimeoutException()