Alon Bar-Lev has posted comments on this change.

Change subject: packaging: setup: Clean up treatment of /etc/exports
......................................................................


Patch Set 6:

(3 comments)

....................................................
File packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py
Line 156:                 new_line = exports_content.pop(exports_index)
Line 157:                 if exports_clients != default_clients:
Line 158:                     self.environment[
Line 159:                         osetupcons.CoreEnv.UNINSTALL_UNREMOVABLE_FILES
Line 160:                     ].append(self._conf)
this is going way too complex.

I prefer to overwrite and leave a backup and be done with this complex logic.

see how much words you use to describe what should be trivial.
Line 161:             exports_d_content, exports_d_index, exports_d_clients = (
Line 162:                 self._read_and_find_path(
Line 163:                     self._conf,
Line 164:                     path


Line 161:             exports_d_content, exports_d_index, exports_d_clients = (
Line 162:                 self._read_and_find_path(
Line 163:                     self._conf,
Line 164:                     path
Line 165:                 )
if file exists leave it, simple logic.
Line 166:             )
Line 167:             if exports_d_index is not None:
Line 168:                 self.logger.debug(
Line 169:                     '{path} already in {conf}, not changing 
it'.format(


Line 168:                 self.logger.debug(
Line 169:                     '{path} already in {conf}, not changing 
it'.format(
Line 170:                         path=path,
Line 171:                         conf=self._conf,
Line 172:                     )
adding more condition in code just for debug makes code unreadable and harder 
to maintain.

if you want eye catcher you can always write 'signature' if x else 'signature', 
but this should be used only if truly required, as you can always find 
exports_d_index=
Line 173:                 )
Line 174:             else:
Line 175:                 
self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
Line 176:                     filetransaction.FileTransaction(


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I035817c048518f77fc666cc6d5212c8e46edd65d
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <d...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Ofer Schreiber <oschr...@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