Greg Padgett has posted comments on this change.

Change subject: agent: update logic and use state machine
......................................................................


Patch Set 2:

(2 comments)

....................................................
File ovirt_hosted_engine_ha/agent/hosted_engine.py
Line 638:     def _handle_entry(self):
Line 639:         """
Line 640:         ENTRY state.  Determine current vm state and switch 
appropriately.
Line 641:         """
Line 642:         local_host_id = self._local_state['host-id']
Thanks for the suggestion.  I tried rewriting some of it this way for the 
latest patch but didn't proceed... IMO, multiple returns improves code clarity 
for some of the states with more logic, e.g. migration state in latest patch.  
Thoughts?
Line 643:         if self._all_host_stats[local_host_id]['engine-status'][:5] 
== 'vm-up':
Line 644:             return self.States.ON, False
Line 645:         else:
Line 646:             return self.States.OFF, False


Line 742:             self._log.error("Engine vm unexpectedly running on other 
host")
Line 743:             return self.States.OFF, True
Line 744: 
Line 745:         # FIXME migration if other hosts are found to be 
significantly better
Line 746:         # TODO check for health, just just liveness
Done
Line 747:         self._log.info("Engine vm running on localhost")
Line 748:         return self.States.ON, True
Line 749: 
Line 750:     def _handle_stop(self):


-- 
To view, visit http://gerrit.ovirt.org/18051
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iad9906d50a5fffb4c9f362b43f0064bf6be4dbde
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-hosted-engine-ha
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
Gerrit-Reviewer: Greg Padgett <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to