Alon Bar-Lev has posted comments on this change.

Change subject: core: Remove Windows ProductKey* from db
......................................................................


Patch Set 6:

(3 comments)

....................................................
File packaging/setup/plugins/ovirt-engine-setup/config/productkey_upgrade.py
Line 46:         'ProductKeyWindow7': 'windows_7',
Line 47:         'ProductKeyWindow7x64': 'windows_7x64',
Line 48:         'ProductKeyWindows8': 'windows_8',
Line 49:         'ProductKeyWindows8x64': 'windows_8x64',
Line 50:         'ProductKeyWindows2012x64': 'windows_2012x64'
always have commas at last element, so future patches will not modify static 
lines.
Line 51:     }
Line 52: 
Line 53:     def __init__(self, context):
Line 54:         super(Plugin, self).__init__(context=context)


Line 58:         after=(
Line 59:             osetupcons.Stages.DB_CONNECTION_AVAILABLE,
Line 60:         ),
Line 61:     )
Line 62: 
drop the space line...

BTW: run ./packaging/check.sh and fix all...
Line 63:     def _misc(self):
Line 64:         if 
os.path.exists(osetupcons.FileLocations.EXTRACTED_PRODUCTKEYS):
Line 65:             return
Line 66: 


Line 61:     )
Line 62: 
Line 63:     def _misc(self):
Line 64:         if 
os.path.exists(osetupcons.FileLocations.EXTRACTED_PRODUCTKEYS):
Line 65:             return
please do not return at middle of functions...

you can... if you want, you can choose between, one large if scope.

or:

 @plugin.event(
        stage=plugin.Stages.STAGE_MISC,
        after=(
            osetupcons.Stages.DB_CONNECTION_AVAILABLE,
        ),
        condition=lambda self:  not os.path.exists(
            osetupcons.FileLocations.EXTRACTED_PRODUCTKEYS
        ),
 )

or:

add _enabled member make it false on constructor, initialize in STAGE_INIT to 
the not os.path.exists(...), and add:

 condition=lambda self: self._enabled.
Line 66: 
Line 67:         content = []
Line 68:         for key in self.DB_TO_OSINFO.keys():
Line 69:             val = 
self.environment[osetupcons.DBEnv.STATEMENT].getVdcOption(key)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I876894e7ba5fcd28ee0d435b4a2561f662140174
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <fkob...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Frank Kobzik <fkob...@redhat.com>
Gerrit-Reviewer: Itamar Heim <ih...@redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skriva...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com>
Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to