Alon Bar-Lev has posted comments on this change.

Change subject: packaging: allow interactive NFS exports cleanup with 
engine-cleanup-2
......................................................................


Patch Set 2: (8 inline comments)

....................................................
File packaging/setup/ovirt_engine_setup/constants.py
Line 509:     ANSWER_FILE = 'OVESETUP_CORE/answerFile'
Line 510:     DEVELOPER_MODE = 'OVESETUP_CORE/developerMode'
Line 511:     UNINSTALL_UNREMOVABLE_FILES = 
'OVESETUP_CORE/uninstallUnremovableFiles'
Line 512:     REMOVE = 'OVESETUP_CORE/remove'
Line 513:     UNINSTALL_PREFIX = 'OVESETUP_CORE_MODIFIED_FILE_GROUP/'
UNINSTALL_GROUP_PREFIX?
Line 514:     UNINSTALL_UNREMOVABLE_GROUPS = 'OVESETUP_CORE/unremovableGroups'
Line 515: 
Line 516: 
Line 517: @util.export


Line 510:     DEVELOPER_MODE = 'OVESETUP_CORE/developerMode'
Line 511:     UNINSTALL_UNREMOVABLE_FILES = 
'OVESETUP_CORE/uninstallUnremovableFiles'
Line 512:     REMOVE = 'OVESETUP_CORE/remove'
Line 513:     UNINSTALL_PREFIX = 'OVESETUP_CORE_MODIFIED_FILE_GROUP/'
Line 514:     UNINSTALL_UNREMOVABLE_GROUPS = 'OVESETUP_CORE/unremovableGroups'
Maybe my English is bad... but the UNREMOVABLE was for stuff we must not touch.

Maybe UNINSTALL_DISABLED_GROUP ?
Line 515: 
Line 516: 
Line 517: @util.export
Line 518: @util.codegen


....................................................
File packaging/setup/plugins/ovirt-engine-remove/files/simple.py
Line 102:                         files.setdefault(comps[1], {})[comps[2]] = 
value
Line 103:                 return {f['name']: f['md5'] for f in files.values()}
Line 104: 
Line 105:             files.update(getFiles('files'))
Line 106:             for uninstall_key in [
uninstall_group?
Line 107:                 key[len(osetupcons.CoreEnv.UNINSTALL_PREFIX):]
Line 108:                 for key in self.environment
Line 109:                 if key.startswith(
Line 110:                     osetupcons.CoreEnv.UNINSTALL_PREFIX


Line 115:             unremovable.update(getFiles('unremovable'))
Line 116:             for uninstall_key in self.environment[
Line 117:                 osetupcons.CoreEnv.UNINSTALL_UNREMOVABLE_GROUPS
Line 118:             ]:
Line 119:                 unremovable.update(getFiles(uninstall_key))
I prefer we simply do not add the disabled groups.
Line 120: 
Line 121:         toremove = set(files.keys()) - set(unremovable.keys())
Line 122:         self.logger.debug('files=%s', files)
Line 123:         self.logger.debug('unremovable=%s', unremovable)


....................................................
File packaging/setup/plugins/ovirt-engine-setup/core/uninstall.py
Line 103:                 osetupcons.CoreEnv.UNINSTALL_PREFIX
Line 104:             )
Line 105:         ]:
Line 106:             _addFiles(
Line 107:                 section,
better to have some kind of prefix to these sections.
Line 108:                 content,
Line 109:             )
Line 110: 
Line 111:         output = os.path.join(


....................................................
File packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py
Line 102:         what we had before.
Line 103:         In /etc/exports make sure we have our own path.
Line 104:         """
Line 105:         uninstall_key = osetupcons.CoreEnv.UNINSTALL_PREFIX + 
'exportfs'
Line 106:         self.environment[uninstall_key] = []
you don't need to initialize it.
Line 107:         path = self.environment[
Line 108:             osetupcons.ConfigEnv.ISO_DOMAIN_NFS_MOUNT_POINT
Line 109:         ]
Line 110:         content = '{path}\t0.0.0.0/0.0.0.0(rw)\n'.format(


Line 126:         else:
Line 127:             self._delete_path(
Line 128:                 path,
Line 129:                 osetupcons.FileLocations.NFS_EXPORT_FILE,
Line 130:                 self.environment[uninstall_key]
a

 self.environemnt.setdefault(
     osetupcons.CoreEnv.UNINSTALL_PREFIX + 'exportfs',
     []
 )

?
Line 131:             )
Line 132: 
Line 133:         self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
Line 134:             filetransaction.FileTransaction(


Line 133:         self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
Line 134:             filetransaction.FileTransaction(
Line 135:                 name=self._conf,
Line 136:                 content=content,
Line 137:                 modifiedList=self.environment[uninstall_key],
ok... so you need...

So what about:

 list = []
 self.environemnt[osetupcons.CoreEnv.UNINSTALL_PREFIX + 'exportfs'] = list

and update list, as all is by reference...
Line 138:             )
Line 139:         )
Line 140: 
Line 141:     @plugin.event(


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I16b5920f0cfc9f564aa92f7e0d5a6d33af5e0b44
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to