def _host_find(context, session, src_aggregate, host_ref):
 uuid = session.host.get_uuid(host_ref)
 for (compute_host, host_uuid) in src_aggregate.metadetails.items():
  if (host_uuid == uuid):
   return compute_host
 raise exception.NoValidHost(reason=('Host %(host_uuid)s could not be found from aggregate metadata: %(metadata)s.' % {'host_uuid': uuid, 'metadata': src_aggregate.metadetails}))

def _host_find ( context , session , src_aggregate , host_ref ) : uuid = session . host . get_uuid ( host_ref ) for ( compute_host , host_uuid ) in src_aggregate . metadetails . items ( ) : if ( host_uuid == uuid ) : return compute_host raise exception . NoValidHost ( reason = ( 'Host %(host_uuid)s could not be found from aggregate metadata: %(metadata)s.' % { 'host_uuid' : uuid , 'metadata' : src_aggregate . metadetails } ) )
return the host from the xenapi host reference .