Sandro Bonazzola has posted comments on this change.

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


Patch Set 5:

(2 comments)

....................................................
File packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py
Line 119:             self._conf = 
osetupcons.FileLocations.OVIRT_NFS_EXPORT_FILE
Line 120:             if index is not None:
Line 121:                 exports_changed = True
Line 122:                 new_line = exports_content[index]
Line 123:                 del exports_content[index]
> is there a different?

well, pop is a method of the object and del is an overloaded built-in.

I usually prefer using methods for changing object internal status instead of 
using something external.
Line 124:             
self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
Line 125:                 filetransaction.FileTransaction(
Line 126:                     name=self._conf,
Line 127:                     content=[new_line],


Line 119:             self._conf = 
osetupcons.FileLocations.OVIRT_NFS_EXPORT_FILE
Line 120:             if index is not None:
Line 121:                 exports_changed = True
Line 122:                 new_line = exports_content[index]
Line 123:                 del exports_content[index]
> Thanks, Sandro. I think I also tend to use push/pop only for stacks.

np, I'm fine keeping del.
Line 124:             
self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
Line 125:                 filetransaction.FileTransaction(
Line 126:                     name=self._conf,
Line 127:                     content=[new_line],


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