def wait_for_created(upid, timeout=300):
 start_time = time.time()
 info = _lookup_proxmox_task(upid)
 if (not info):
  log.error('wait_for_created: No task information retrieved based on given criteria.')
  raise SaltCloudExecutionFailure
 while True:
  if (('status' in info) and (info['status'] == 'OK')):
   log.debug('Host has been created!')
   return True
  time.sleep(3)
  if ((time.time() - start_time) > timeout):
   log.debug('Timeout reached while waiting for host to be created')
   return False
  info = _lookup_proxmox_task(upid)

def wait_for_created ( upid , timeout = 300 ) : start_time = time . time ( ) info = _lookup_proxmox_task ( upid ) if ( not info ) : log . error ( 'wait_for_created: No task information retrieved based on given criteria.' ) raise SaltCloudExecutionFailure while True : if ( ( 'status' in info ) and ( info [ 'status' ] == 'OK' ) ) : log . debug ( 'Host has been created!' ) return True time . sleep ( 3 ) if ( ( time . time ( ) - start_time ) > timeout ) : log . debug ( 'Timeout reached while waiting for host to be created' ) return False info = _lookup_proxmox_task ( upid )
wait until a the vm has been created successfully .