Francesco Romani has posted comments on this change. Change subject: vm: extract migration completion check ......................................................................
Patch Set 6: Code-Review-1 (3 comments) I'm fine with this concept, makes the code nicer. -1 for visibility, see inline comments. https://gerrit.ovirt.org/#/c/47086/6/vdsm/virt/vm.py File vdsm/virt/vm.py: Line 2775: del self.conf['username'] Line 2776: self.saveState() Line 2777: self.log.info("End of migration") Line 2778: Line 2779: def _needToWaitForMigrationToComplete(self): ok, this helper can indeed be extracted and I'm Ok with this move. Line 2780: if not self.recovering: Line 2781: return True Line 2782: Line 2783: try: Line 2776: self.saveState() Line 2777: self.log.info("End of migration") Line 2778: Line 2779: def _needToWaitForMigrationToComplete(self): Line 2780: if not self.recovering: please add a comment to explain this early return, something like # if it is not recovering, we are in the base flow, so we need to wait for the migration to complete Line 2781: return True Line 2782: Line 2783: try: Line 2784: if self._isDomainRunning(): Line 2780: if not self.recovering: Line 2781: return True Line 2782: Line 2783: try: Line 2784: if self._isDomainRunning(): Since we are factoring out this code with some changes, it is a bit nicer and more consistent this way: try: if not self._isDomainRunning(): return True except ... ... else: self.log.info(...) return False otherwise, you can take the opposite direction and just copy/paste the above code into a new helper. Whatever fits you best. Line 2785: self.log.info('migration completed while recovering!') Line 2786: return False Line 2787: else: Line 2788: return True -- To view, visit https://gerrit.ovirt.org/47086 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia1afb406e3e2ca7b37a621fc1bcc8bc1bf37031b Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Betak <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Betak <[email protected]> Gerrit-Reviewer: Martin Polednik <[email protected]> Gerrit-Reviewer: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
