Merge "OVS agent: always send start flag during initial sync"
This commit is contained in:
commit
6df95b72cf
|
@ -348,11 +348,16 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
|
||||||
self.fullsync = True
|
self.fullsync = True
|
||||||
|
|
||||||
# we only want to update resource versions on startup
|
# we only want to update resource versions on startup
|
||||||
self.agent_state.pop('resource_versions', None)
|
if self.agent_state.pop('resource_versions', None):
|
||||||
if self.agent_state.pop('start_flag', None) and self.iter_num == 0:
|
|
||||||
# On initial start, we notify systemd after initialization
|
# On initial start, we notify systemd after initialization
|
||||||
# is complete.
|
# is complete.
|
||||||
systemd.notify_once()
|
systemd.notify_once()
|
||||||
|
|
||||||
|
if self.iter_num > 0:
|
||||||
|
# agent is considered started after
|
||||||
|
# initial sync with server (iter 0) is done
|
||||||
|
self.agent_state.pop('start_flag', None)
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
self.failed_report_state = True
|
self.failed_report_state = True
|
||||||
LOG.exception("Failed reporting state!")
|
LOG.exception("Failed reporting state!")
|
||||||
|
|
|
@ -1145,7 +1145,8 @@ class TestOvsNeutronAgent(object):
|
||||||
self.agent.agent_state, True)
|
self.agent.agent_state, True)
|
||||||
self.systemd_notify.assert_called_once_with()
|
self.systemd_notify.assert_called_once_with()
|
||||||
self.systemd_notify.reset_mock()
|
self.systemd_notify.reset_mock()
|
||||||
self.assertNotIn("start_flag", self.agent.agent_state)
|
# agent keeps sending "start_flag" while iter 0 not completed
|
||||||
|
self.assertIn("start_flag", self.agent.agent_state)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.agent.agent_state["configurations"]["devices"],
|
self.agent.agent_state["configurations"]["devices"],
|
||||||
self.agent.int_br_device_count
|
self.agent.int_br_device_count
|
||||||
|
|
Loading…
Reference in New Issue