diff --git a/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py b/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py index 70d5e2aa8..75da05363 100644 --- a/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py +++ b/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py @@ -1538,11 +1538,11 @@ class ApicMechanismDriver(api_plus.MechanismDriver, # Topology RPC method handler def update_link(self, context, host, interface, mac, - switch, module, port, port_description=''): + switch, module, port, pod_id='1', port_description=''): LOG.debug('Topology RPC: update_link: %s', ', '.join([str(p) for p in (host, interface, mac, switch, module, port, - port_description)])) + pod_id, port_description)])) if not switch: self.delete_link(context, host, interface, mac, switch, module, port) @@ -1556,7 +1556,7 @@ class ApicMechanismDriver(api_plus.MechanismDriver, if not hlink or hlink.path != port_description: attrs = dict(interface_mac=mac, switch_id=switch, module=module, port=port, - path=port_description) + path=port_description, pod_id=pod_id) if hlink: old_path = hlink.path hlink = self.aim.update(aim_ctx, hlink, **attrs) diff --git a/gbpservice/neutron/tests/unit/plugins/ml2plus/test_apic_aim.py b/gbpservice/neutron/tests/unit/plugins/ml2plus/test_apic_aim.py index caa77bfce..542251386 100644 --- a/gbpservice/neutron/tests/unit/plugins/ml2plus/test_apic_aim.py +++ b/gbpservice/neutron/tests/unit/plugins/ml2plus/test_apic_aim.py @@ -5202,12 +5202,12 @@ class TestPortVlanNetwork(ApicAimTestCase): epg1 = self._net_2_epg(net1) # add hostlink for h10 - self.driver.update_link(nctx, 'h10', 'eth0', 'A:A', 101, 1, 19, - 'topology/pod-1/paths-101/pathep-[eth1/19]') + self.driver.update_link(nctx, 'h10', 'eth0', 'A:A', 101, 1, 19, '2', + 'topology/pod-2/paths-101/pathep-[eth1/19]') expected_hlink10 = aim_infra.HostLink(host_name='h10', interface_name='eth0', interface_mac='A:A', - switch_id='101', module='1', port='19', - path='topology/pod-1/paths-101/pathep-[eth1/19]') + switch_id='101', module='1', port='19', pod_id='2', + path='topology/pod-2/paths-101/pathep-[eth1/19]') self.assertEqual(expected_hlink10, self.aim_mgr.get(aim_ctx, expected_hlink10)) epg1 = self.aim_mgr.get(aim_ctx, epg1) @@ -5247,32 +5247,32 @@ class TestPortVlanNetwork(ApicAimTestCase): self.assertEqual(expected_path, epgs[x].static_paths) # add hostlink for h10 - self.driver.update_link(nctx, 'h10', 'eth0', 'A:A', 101, 1, 19, - 'topology/pod-1/paths-101/pathep-[eth1/19]') + self.driver.update_link(nctx, 'h10', 'eth0', 'A:A', 101, 1, 19, '2', + 'topology/pod-2/paths-101/pathep-[eth1/19]') expected_hlink10 = aim_infra.HostLink(host_name='h10', interface_name='eth0', interface_mac='A:A', - switch_id='101', module='1', port='19', - path='topology/pod-1/paths-101/pathep-[eth1/19]') + switch_id='101', module='1', port='19', pod_id='2', + path='topology/pod-2/paths-101/pathep-[eth1/19]') self.assertEqual(expected_hlink10, self.aim_mgr.get(aim_ctx, expected_hlink10)) check_epg_static_paths(expected_hlink10.path) # update link - self.driver.update_link(nctx, 'h10', 'eth0', 'A:A', 101, 1, 42, - 'topology/pod-1/paths-101/pathep-[eth1/42]') + self.driver.update_link(nctx, 'h10', 'eth0', 'A:A', 101, 1, 42, '2', + 'topology/pod-2/paths-101/pathep-[eth1/42]') expected_hlink10.port = '42' - expected_hlink10.path = 'topology/pod-1/paths-101/pathep-[eth1/42]' + expected_hlink10.path = 'topology/pod-2/paths-101/pathep-[eth1/42]' self.assertEqual(expected_hlink10, self.aim_mgr.get(aim_ctx, expected_hlink10)) check_epg_static_paths(expected_hlink10.path) # add another link (VPC like) - self.driver.update_link(nctx, 'h10', 'eth1', 'B:B', 201, 1, 24, - 'topology/pod-1/paths-101/pathep-[eth1/42]') + self.driver.update_link(nctx, 'h10', 'eth1', 'B:B', 201, 1, 24, '2', + 'topology/pod-2/paths-101/pathep-[eth1/42]') expected_hlink10_sec = aim_infra.HostLink(host_name='h10', interface_name='eth1', interface_mac='B:B', - switch_id='201', module='1', port='24', - path='topology/pod-1/paths-101/pathep-[eth1/42]') + switch_id='201', module='1', port='24', pod_id='2', + path='topology/pod-2/paths-101/pathep-[eth1/42]') self.assertEqual(expected_hlink10_sec, self.aim_mgr.get(aim_ctx, expected_hlink10_sec)) check_epg_static_paths(expected_hlink10.path) @@ -5283,7 +5283,7 @@ class TestPortVlanNetwork(ApicAimTestCase): check_epg_static_paths(expected_hlink10.path) # remove first link - self.driver.update_link(nctx, 'h10', 'eth0', 'A:A', 0, 0, 0, '') + self.driver.update_link(nctx, 'h10', 'eth0', 'A:A', 0, 0, 0, 0, '') self.assertIsNone(self.aim_mgr.get(aim_ctx, expected_hlink10)) check_epg_static_paths(None)