Martin Sivák has submitted this change and it was merged.
Change subject: Separate the state machine into machine, states with logic and
communication
......................................................................
Separate the state machine into machine, states with logic and communication
The FSM is designed in such a way that each state is essentially
immutable and knows only about the world that was seen when the
state was created.
When consume is called it uses the remembered info and the new info
to determine where to go next and returns a new state instance.
This allows us to write unit tests for each state without having
to mock anything as all decisions are based only on passed immutable
structures.
This patch also kills some of the timers we used and replaces them
with separate states and universal check_timer decorator.
Change-Id: Icad82e819b653cd8b9210d0a71e0312fc6b20134
Signed-off-by: Martin Sivak <msivak(a)redhat.com>
---
M configure.ac
M ovirt_hosted_engine_ha/agent/Makefile.am
M ovirt_hosted_engine_ha/agent/agent.py
M ovirt_hosted_engine_ha/agent/hosted_engine.py
A ovirt_hosted_engine_ha/agent/state_data.py
A ovirt_hosted_engine_ha/agent/state_decorators.py
A ovirt_hosted_engine_ha/agent/state_machine.py
A ovirt_hosted_engine_ha/agent/states.py
M ovirt_hosted_engine_ha/lib/Makefile.am
A ovirt_hosted_engine_ha/lib/fsm/Makefile.am
A ovirt_hosted_engine_ha/lib/fsm/__init__.py
A ovirt_hosted_engine_ha/lib/fsm/machine.py
M ovirt_hosted_engine_ha/lib/metadata.py
M ovirt_hosted_engine_ha/lib/util.py
14 files changed, 1,565 insertions(+), 842 deletions(-)
Approvals:
Martin Sivák: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/24818
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icad82e819b653cd8b9210d0a71e0312fc6b20134
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-ha
Gerrit-Branch: ovirt-hosted-engine-ha-1.1
Gerrit-Owner: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server