self.root_helper = root_helper
self.available_local_vlans = set(moves.xrange(q_const.MIN_VLAN_TAG,
q_const.MAX_VLAN_TAG))
+ self.use_call = True
self.tunnel_types = tunnel_types or []
self.l2_pop = l2_population
# TODO(ethuleau): Change ARP responder so it's not dependent on the
self.int_br_device_count)
try:
self.state_rpc.report_state(self.context,
- self.agent_state)
+ self.agent_state,
+ self.use_call)
+ self.use_call = False
self.agent_state.pop('start_flag', None)
except Exception:
LOG.exception(_("Failed reporting state!"))
self.agent.int_br_device_count = 5
self.agent._report_state()
report_st.assert_called_with(self.agent.context,
- self.agent.agent_state)
+ self.agent.agent_state, True)
self.assertNotIn("start_flag", self.agent.agent_state)
+ self.assertFalse(self.agent.use_call)
self.assertEqual(
self.agent.agent_state["configurations"]["devices"],
self.agent.int_br_device_count
)
+ self.agent._report_state()
+ report_st.assert_called_with(self.agent.context,
+ self.agent.agent_state, False)
+
+ def test_report_state_fail(self):
+ with mock.patch.object(self.agent.state_rpc,
+ "report_state") as report_st:
+ report_st.side_effect = Exception()
+ self.agent._report_state()
+ report_st.assert_called_with(self.agent.context,
+ self.agent.agent_state, True)
+ self.agent._report_state()
+ report_st.assert_called_with(self.agent.context,
+ self.agent.agent_state, True)
def test_network_delete(self):
with contextlib.nested(