def vb_get_network_adapters(machine_name=None, machine=None):
 if machine_name:
  machine = vb_get_box().findMachine(machine_name)
 network_adapters = []
 for i in range(vb_get_max_network_slots()):
  try:
   inetwork_adapter = machine.getNetworkAdapter(i)
   network_adapter = vb_xpcom_to_attribute_dict(inetwork_adapter, 'INetworkAdapter')
   network_adapter['properties'] = inetwork_adapter.getProperties('')
   network_adapters.append(network_adapter)
  except Exception:
   pass
 return network_adapters

def vb_get_network_adapters ( machine_name = None , machine = None ) : if machine_name : machine = vb_get_box ( ) . findMachine ( machine_name ) network_adapters = [ ] for i in range ( vb_get_max_network_slots ( ) ) : try : inetwork_adapter = machine . getNetworkAdapter ( i ) network_adapter = vb_xpcom_to_attribute_dict ( inetwork_adapter , 'INetworkAdapter' ) network_adapter [ 'properties' ] = inetwork_adapter . getProperties ( '' ) network_adapters . append ( network_adapter ) except Exception : pass return network_adapters
a valid machine_name or a machine is needed to make this work! .