def _nova_to_osvif_network(network):
 netobj = objects.network.Network(id=network['id'], bridge_interface=network.get_meta('bridge_interface'), subnets=_nova_to_osvif_subnets(network['subnets']))
 if (network['bridge'] is not None):
  netobj.bridge = network['bridge']
 if (network['label'] is not None):
  netobj.label = network['label']
 if (network.get_meta('mtu') is not None):
  netobj.mtu = network.get_meta('mtu')
 if (network.get_meta('multi_host') is not None):
  netobj.multi_host = network.get_meta('multi_host')
 if (network.get_meta('should_create_bridge') is not None):
  netobj.should_provide_bridge = network.get_meta('should_create_bridge')
 if (network.get_meta('should_create_vlan') is not None):
  netobj.should_provide_vlan = network.get_meta('should_create_vlan')
  if (network.get_meta('vlan') is None):
   raise exception.NovaException((_('Missing vlan number in %s') % network))
  netobj.vlan = network.get_meta('vlan')
 return netobj

def _nova_to_osvif_network ( network ) : netobj = objects . network . Network ( id = network [ 'id' ] , bridge_interface = network . get_meta ( 'bridge_interface' ) , subnets = _nova_to_osvif_subnets ( network [ 'subnets' ] ) ) if ( network [ 'bridge' ] is not None ) : netobj . bridge = network [ 'bridge' ] if ( network [ 'label' ] is not None ) : netobj . label = network [ 'label' ] if ( network . get_meta ( 'mtu' ) is not None ) : netobj . mtu = network . get_meta ( 'mtu' ) if ( network . get_meta ( 'multi_host' ) is not None ) : netobj . multi_host = network . get_meta ( 'multi_host' ) if ( network . get_meta ( 'should_create_bridge' ) is not None ) : netobj . should_provide_bridge = network . get_meta ( 'should_create_bridge' ) if ( network . get_meta ( 'should_create_vlan' ) is not None ) : netobj . should_provide_vlan = network . get_meta ( 'should_create_vlan' ) if ( network . get_meta ( 'vlan' ) is None ) : raise exception . NovaException ( ( _ ( 'Missing vlan number in %s' ) % network ) ) netobj . vlan = network . get_meta ( 'vlan' ) return netobj
convert nova network object into os_vif object .