Yedidyah Bar David 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 means that: 1. If we only have /etc/exports, we add a line, admin changed it, we won't touch it on cleanup (we delete only orig text if found) or on a later setup 2. If we only have /etc/exports.d/file, admin changed it, we won't touch it on cleanup (md5) and on a further setup I'd like to have the same thing also on a migration from /etc/exports to /etc/exports.d/file. To do that: 3. If the line we move is different from our default line minus the comment (which was different in 3.2 downstream/upstream, didn't check earlier versions), I mark also this file as unremovable. This way it won't be removed on cleanup, and (2) above means also not on further updates. 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: ) I agree in principle, but in practice you already said we want the same behavior with both files. Do you see some way to do that without parsing both? 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: ) Done. Although I personally find it much more convenient, when reading a log file, to see also 'path already in conf, not changing it' than just the values of some variables. And we do this in other places too. 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