def _bind_port_nwa_debug_message(self, context): network_name, network_id = nwa_l2_utils.get_network_info(context) device_owner = context._port['device_owner'] subnet_ids = [] if 'fixed_ips' in context._port: for fixed_ip in context._port['fixed_ips']: subnet_ids.append(fixed_ip['subnet_id']) segmentation_id = 0 if prov_net.PHYSICAL_NETWORK in context.network.current: segmentation_id = context.network.current[prov_net.SEGMENTATION_ID] else: for provider in context.network.current['segments']: if (provider.get(prov_net.PHYSICAL_NETWORK) == nwa_l2_utils.get_physical_network( device_owner, self.resource_groups)): segmentation_id = provider[prov_net.SEGMENTATION_ID] break LOG.debug("provider segmentation_id = %s", segmentation_id) LOG.debug( "_bind_port_nwa %(network_name)s " "%(network_id)s %(device_id)s %(device_owner)s " "%(port_id)s %(mac_address)s %(subnet_ids)s " "%(segmentation_id)s", { 'network_name': network_name, 'network_id': network_id, 'device_id': context._port['device_id'], 'device_owner': device_owner, 'port_id': context._port['id'], 'mac_address': context._port['mac_address'], 'subnet_ids': subnet_ids, 'segmentation_id': segmentation_id })
def _bind_port_nwa_debug_message(self, context): network_name, network_id = nwa_l2_utils.get_network_info(context) device_owner = context._port['device_owner'] subnet_ids = [] if 'fixed_ips' in context._port: for fixed_ip in context._port['fixed_ips']: subnet_ids.append(fixed_ip['subnet_id']) segmentation_id = 0 if prov_net.PHYSICAL_NETWORK in context.network.current: segmentation_id = context.network.current[prov_net.SEGMENTATION_ID] else: for provider in context.network.current['segments']: if (provider.get(prov_net.PHYSICAL_NETWORK) == nwa_l2_utils.get_physical_network( device_owner, self.resource_groups)): segmentation_id = provider[prov_net.SEGMENTATION_ID] break LOG.debug("provider segmentation_id = %s", segmentation_id) LOG.debug("_bind_port_nwa %(network_name)s " "%(network_id)s %(device_id)s %(device_owner)s " "%(port_id)s %(mac_address)s %(subnet_ids)s " "%(segmentation_id)s", {'network_name': network_name, 'network_id': network_id, 'device_id': context._port['device_id'], 'device_owner': device_owner, 'port_id': context._port['id'], 'mac_address': context._port['mac_address'], 'subnet_ids': subnet_ids, 'segmentation_id': segmentation_id})
def test_get_network_info(self): net, nid = nwa_l2_utils.get_network_info(self.context) self.assertEqual(net, 'PublicVLAN_100') self.assertEqual(nid, 'Uuid-PublicVLAN_100')
def test_get_network_info(self): net, nid = nwa_l2_utils.get_network_info(self.context) self.assertEqual(net, 'PublicVLAN_100') self.assertEqual(nid, 'Uuid-PublicVLAN_100')