def ensure_correct_host(session):
 this_vm_uuid = get_this_vm_uuid()
 try:
  session.call_xenapi('VM.get_by_uuid', this_vm_uuid)
 except session.XenAPI.Failure as exc:
  if (exc.details[0] != 'UUID_INVALID'):
   raise
  raise Exception(_('This domU must be running on the host specified by xenapi_connection_url'))

def ensure_correct_host ( session ) : this_vm_uuid = get_this_vm_uuid ( ) try : session . call_xenapi ( 'VM.get_by_uuid' , this_vm_uuid ) except session . XenAPI . Failure as exc : if ( exc . details [ 0 ] != 'UUID_INVALID' ) : raise raise Exception ( _ ( 'This domU must be running on the host specified by xenapi_connection_url' ) )
ensure were connected to the host were running on .