X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=nfvbench%2Fchain_router.py;h=99114e02d0b66ee3b9cf632554d87e4a30eb0728;hb=a122713a5207a189d659d2d05d31e272b4c544f3;hp=ac8947608b41eace3936367d223d803444cff596;hpb=95f2491ed89ac99b0d8bd006b4a13cbeb1eb96ce;p=nfvbench.git diff --git a/nfvbench/chain_router.py b/nfvbench/chain_router.py index ac89476..99114e0 100644 --- a/nfvbench/chain_router.py +++ b/nfvbench/chain_router.py @@ -80,6 +80,11 @@ class ChainRouter(object): .format(router=self.name, sub_id=subnet.network['subnets'][0])) interfaces = self.manager.neutron_client.list_ports(device_id=router['id'])['ports'] + # This string filters nfvbench networks in case when some other specific networks + # created and attached to the test nfvebnch router manually or automatically + # like in case of HA when neutron router virtually present on several network nodes + interfaces = [x for x in interfaces if x['fixed_ips'][0]['subnet_id'] in + [s.network['subnets'][0] for s in self.subnets]] for interface in interfaces: if self.is_ip_in_network( interface['fixed_ips'][0]['ip_address'], @@ -125,6 +130,8 @@ class ChainRouter(object): router_interface = {'subnet_id': subnet.network['subnets'][0]} self.manager.neutron_client.add_interface_router(router_id, router_interface) interfaces = self.manager.neutron_client.list_ports(device_id=router_id)['ports'] + interfaces = [x for x in interfaces if x['fixed_ips'][0]['subnet_id'] in + [s.network['subnets'][0] for s in self.subnets]] for interface in interfaces: itf = interface['fixed_ips'][0]['ip_address'] cidr0 = self.manager.config.traffic_generator.tg_gateway_ip_cidrs[0]