def vb_machine_exists(name):
 try:
  vbox = vb_get_box()
  vbox.findMachine(name)
  return True
 except Exception as e:
  if isinstance(e.message, str):
   message = e.message
  elif (hasattr(e, 'msg') and isinstance(getattr(e, 'msg'), str)):
   message = getattr(e, 'msg')
  else:
   message = ''
  if (0 > message.find('Could not find a registered machine named')):
   log.error(message)
  return False

def vb_machine_exists ( name ) : try : vbox = vb_get_box ( ) vbox . findMachine ( name ) return True except Exception as e : if isinstance ( e . message , str ) : message = e . message elif ( hasattr ( e , 'msg' ) and isinstance ( getattr ( e , 'msg' ) , str ) ) : message = getattr ( e , 'msg' ) else : message = '' if ( 0 > message . find ( 'Could not find a registered machine named' ) ) : log . error ( message ) return False
checks in with the hypervisor to see if the machine with the given name is known .