def _wait_for_device(session, dev, dom0, max_seconds):
 dev_path = utils.make_dev_path(dev)
 found_path = None
 if dom0:
  found_path = session.call_plugin_serialized('partition_utils.py', 'wait_for_dev', dev_path, max_seconds)
 else:
  for i in range(0, max_seconds):
   if os.path.exists(dev_path):
    found_path = dev_path
    break
   time.sleep(1)
 if (found_path is None):
  raise exception.StorageError(reason=(_('Timeout waiting for device %s to be created') % dev))

def _wait_for_device ( session , dev , dom0 , max_seconds ) : dev_path = utils . make_dev_path ( dev ) found_path = None if dom0 : found_path = session . call_plugin_serialized ( 'partition_utils.py' , 'wait_for_dev' , dev_path , max_seconds ) else : for i in range ( 0 , max_seconds ) : if os . path . exists ( dev_path ) : found_path = dev_path break time . sleep ( 1 ) if ( found_path is None ) : raise exception . StorageError ( reason = ( _ ( 'Timeout waiting for device %s to be created' ) % dev ) )
wait for device node to appear .