else:
self.fip_ns.create_gateway_port(fip_agent_port)
- if self.fip_ns.agent_gateway_port and floating_ips:
- if self.dist_fip_count == 0 or is_first:
+ if (self.fip_ns.agent_gateway_port and
+ (self.dist_fip_count == 0 or is_first)):
self.fip_ns.create_rtr_2_fip_link(self)
# kicks the FW Agent to add rules for the IR namespace if
ri.dist_fip_count = 0
ri.fip_ns.subscribe = mock.Mock()
ri.fip_ns.agent_router_gateway = mock.Mock()
+ agent.process_router_add = mock.Mock()
with mock.patch.object(ri, 'get_floating_ips') as fips, \
mock.patch.object(ri, 'get_floating_agent_gw_interface'
self.assertEqual(ri.fip_ns.agent_gateway_port,
agent_gateway_port[0])
self.assertTrue(ri.rtr_fip_subnet)
+ self.assertEqual(1, agent.process_router_add.call_count)
@mock.patch.object(lla.LinkLocalAllocator, '_write')
def test_create_dvr_fip_interfaces_for_restart_l3agent_case(self,