Alon Bar-Lev has posted comments on this change.
Change subject: packaging: added DB validation functions
......................................................................
Patch Set 6: (4 inline comments)
....................................................
File packaging/setup/plugins/ovirt-engine-setup/upgrade/asynctasks.py
Line 65: 'value': mode,
Line 66: }
Line 67: )
Line 68: except Exception as e:
Line 69: self._parent.logger.debug(
you do not need parent to log if you inherit from base
Line 70: 'Cannot set engine mode',
Line 71: exc_info=True,
Line 72: )
Line 73: raise RuntimeError(
Line 273: compensations =
self._getCompensations(dbstatement)
Line 274: if runningTasks or compensations:
Line 275: self._infoStoppingTasks()
Line 276: else:
Line 277: break
please try to move one liners as first expression.
if xxxx:
long
long
long
long
long
long
long
long
long
long
else:
short
is unreadable, as by the time you get to the short, you forget the condition.
Better:
if not xxxx:
short
else:
long
long
long
long
long
long
long
long
long
long
Line 278: except KeyboardInterrupt:
Line 279: self._askUserToStopTasks(runningTasks,
compensations)
Line 280:
Line 281: @plugin.event(
Line 293:
Line 294: @plugin.event(
Line 295: stage=plugin.Stages.STAGE_SETUP,
Line 296: )
Line 297: def _setup(self):
try....
engine-setup-2 --otopi-environment="DIALOG/customization=bool:True"
Line 298: self._enabled = self.environment[
Line 299: osetupcons.AsyncTasksEnv.CLEAR_TASKS
Line 300: ] is True
Line 301:
Line 309: )
Line 310: def _validation(self):
Line 311: runningTasks, compensations = self._checkRunningTasks()
Line 312: if runningTasks or compensations:
Line 313: self._askUserToStopTasks(runningTasks, compensations)
waiting until no tasks != clearing tasks, no?
Line 314:
Line 315: @plugin.event(
Line 316: # NOTE:
Line 317: # this must run before the package update
--
To view, visit http://gerrit.ovirt.org/15970
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I25979acbf54d980168be929638ff4aed800bf6d3
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Moran Goldboim <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches