def get_tenant_network(creds_provider, compute_networks_client, shared_network_name):
 caller = test_utils.find_test_caller()
 net_creds = creds_provider.get_primary_creds()
 network = getattr(net_creds, 'network', None)
 if ((not network) or (not network.get('name'))):
  if shared_network_name:
   msg = 'No valid network provided or created, defaulting to fixed_network_name'
   if caller:
    msg = ('(%s) %s' % (caller, msg))
   LOG.debug(msg)
   try:
    network = get_network_from_name(shared_network_name, compute_networks_client)
   except exceptions.InvalidTestResource:
    network = {}
 msg = ('Found network %s available for tenant' % network)
 if caller:
  msg = ('(%s) %s' % (caller, msg))
 LOG.info(msg)
 return network

def get_tenant_network ( creds_provider , compute_networks_client , shared_network_name ) : caller = test_utils . find_test_caller ( ) net_creds = creds_provider . get_primary_creds ( ) network = getattr ( net_creds , 'network' , None ) if ( ( not network ) or ( not network . get ( 'name' ) ) ) : if shared_network_name : msg = 'No valid network provided or created, defaulting to fixed_network_name' if caller : msg = ( '(%s) %s' % ( caller , msg ) ) LOG . debug ( msg ) try : network = get_network_from_name ( shared_network_name , compute_networks_client ) except exceptions . InvalidTestResource : network = { } msg = ( 'Found network %s available for tenant' % network ) if caller : msg = ( '(%s) %s' % ( caller , msg ) ) LOG . info ( msg ) return network
get a network usable by the primary tenant .