def _wait_for_device(dev):
    for i in range(0, CONF.xenserver.block_device_creation_timeout):
        dev_path = utils.make_dev_path(dev)
        if os.path.exists(dev_path):
            return
        time.sleep(1)

    raise exception.StorageError(
        reason=_('Timeout waiting for device %s to be created') % dev)
Wait for device node to appear.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/vm_utils.py/_wait_for_device