def get_network_domain(driver, locator, location):
 if is_uuid(locator):
  net_id = locator
 else:
  name = locator
  networks = driver.ex_list_network_domains(location=location)
  found_networks = [network for network in networks if (network.name == name)]
  if (not found_networks):
   raise UnknownNetworkError(("Network '%s' could not be found" % name))
  net_id = found_networks[0].id
 return driver.ex_get_network_domain(net_id)

def get_network_domain ( driver , locator , location ) : if is_uuid ( locator ) : net_id = locator else : name = locator networks = driver . ex_list_network_domains ( location = location ) found_networks = [ network for network in networks if ( network . name == name ) ] if ( not found_networks ) : raise UnknownNetworkError ( ( "Network '%s' could not be found" % name ) ) net_id = found_networks [ 0 ] . id return driver . ex_get_network_domain ( net_id )
get a network domain object by its name or id .