Sandro Bonazzola has posted comments on this change.

Change subject: [WIP] packaging: added DB validation functions on upgrade
......................................................................


Patch Set 2: (7 inline comments)

....................................................
File packaging/setup/plugins/ovirt-engine-setup/upgrade/asynctasks.py
Line 59:             )
Line 60:             self.logger.debug(
Line 61:                 'Setting engine into maintenance mode'
Line 62:             )
Line 63:             self._setEngineMode(mode='maintenance')
I suggest to use a constant here
Line 64: 
Line 65:             # Start the engine in maintenance mode
Line 66:             self.services.state(
Line 67:                 name=self.environment[


Line 145:                 _('Failed to clear zombie tasks!')
Line 146:             )
Line 147: 
Line 148:     def _setEngineMode(self, mode='normal'):
Line 149:         if mode == 'maintenace':
typo: better using a constant
Line 150:             self.dbstatement.updateVDCOption(
Line 151:                 {
Line 152:                     'name': 'EngineMode',
Line 153:                     'value': 'MAINTENANCE',


Line 153:                     'value': 'MAINTENANCE',
Line 154:                 }
Line 155:             )
Line 156:             self.in_maintenance = True
Line 157:         elif mode == 'normal':
better using a constant
Line 158:             self.dbstatement.updateVDCOption(
Line 159:                 {
Line 160:                     'name': 'EngineMode',
Line 161:                     'value': 'ACTIVE',


Line 196:                 a.task_id,
Line 197:                 a.started_at,
Line 198:                 b.name
Line 199:                 from async_tasks a, storage_pool b
Line 200:                 where a.storage_pool_id = b.id;
; can be removed
Line 201:             """,
Line 202:         )[0]
Line 203: 
Line 204:         from async_tasks_map import async_tasks_map


Line 224:         compensations = self.dbstatement.execute(
Line 225:             statement="""
Line 226:                 select
Line 227:                 command_type, entity_type
Line 228:                 from business_entity_snapshot;
; can be removed
Line 229:             """,
Line 230:         )[0]
Line 231: 
Line 232:         return '\n'.join(


Line 365:         self.in_maintenance = False
Line 366:         self.originalTimeout = 0
Line 367: 
Line 368:     @plugin.event(
Line 369:         stage=plugin.Stages.STAGE_CUSTOMIZATION,
shouldn't be done @MISC or @VALIDATION?
Line 370:         after=[
Line 371:             osetupcons.Stages.FIX_DB_VIOLATIONS
Line 372:         ],
Line 373:         #before yum update


....................................................
File packaging/setup/plugins/ovirt-engine-setup/upgrade/dbvalidations.py
Line 162:                     prompt=True,
Line 163:                     true=_('Yes'),
Line 164:                     false=_('No'),
Line 165:                 )
Line 166: 
The fix part shouldn't be done @MISC?
Line 167:             if self.environment[
Line 168:                 osetupcons.DBEnv.FIX_DB_VIOLATIONS
Line 169:             ]:
Line 170:                 self._fixDb(


-- 
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: 2
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

Reply via email to