def _find_network_id_novanet(cs, net_name):
 network_id = None
 for net_info in cs.networks.list():
  if (net_name == net_info.label):
   if (network_id is not None):
    msg = (_("Multiple network name matches found for name '%s', use network ID to be more specific.") % net_name)
    raise exceptions.NoUniqueMatch(msg)
   else:
    network_id = net_info.id
 if (network_id is None):
  msg = (_("No network name match for name '%s'") % net_name)
  raise exceptions.ResourceNotFound((msg % {'network': net_name}))
 else:
  return network_id

def _find_network_id_novanet ( cs , net_name ) : network_id = None for net_info in cs . networks . list ( ) : if ( net_name == net_info . label ) : if ( network_id is not None ) : msg = ( _ ( "Multiple network name matches found for name '%s', use network ID to be more specific." ) % net_name ) raise exceptions . NoUniqueMatch ( msg ) else : network_id = net_info . id if ( network_id is None ) : msg = ( _ ( "No network name match for name '%s'" ) % net_name ) raise exceptions . ResourceNotFound ( ( msg % { 'network' : net_name } ) ) else : return network_id
get unique network id from network name .