def get_network_with_the_name(session, network_name='vmnet0', cluster=None):
 vm_networks = session._call_method(vim_util, 'get_object_properties', None, cluster, 'ClusterComputeResource', ['network'])
 while vm_networks:
  if vm_networks.objects:
   network_obj = _get_network_obj(session, vm_networks.objects, network_name)
   if network_obj:
    session._call_method(vutil, 'cancel_retrieval', vm_networks)
    return network_obj
  vm_networks = session._call_method(vutil, 'continue_retrieval', vm_networks)
 LOG.debug('Network %s not found on cluster!', network_name)

def get_network_with_the_name ( session , network_name = 'vmnet0' , cluster = None ) : vm_networks = session . _call_method ( vim_util , 'get_object_properties' , None , cluster , 'ClusterComputeResource' , [ 'network' ] ) while vm_networks : if vm_networks . objects : network_obj = _get_network_obj ( session , vm_networks . objects , network_name ) if network_obj : session . _call_method ( vutil , 'cancel_retrieval' , vm_networks ) return network_obj vm_networks = session . _call_method ( vutil , 'continue_retrieval' , vm_networks ) LOG . debug ( 'Network %s not found on cluster!' , network_name )
gets reference to the network whose name is passed as the argument .