Yedidyah Bar David has uploaded a new change for review. Change subject: packaging: setup: Fix legacy nfs export using /etc/exports ......................................................................
packaging: setup: Fix legacy nfs export using /etc/exports In previous releases, engine-setup exported an ISO domain by adding a line to /etc/exports even on systems that support /etc/exports.d. Fix that by moving the line during engine-setup. Compared to http://gerrit.ovirt.org/20709 , this change does not try to guess if the line was modified or not - if the above fix is done, it's never reverted on engine-cleanup. Change-Id: I6ebddd2de247fd5da88826710a6a2f8202b90d26 Signed-off-by: Yedidyah Bar David <d...@redhat.com> --- M packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/17/22617/1 diff --git a/packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py b/packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py index c09f3c6..8de8ffd 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py +++ b/packaging/setup/plugins/ovirt-engine-setup/system/exportfs.py @@ -175,6 +175,29 @@ modifiedList=uninstall_files, ) ) + elif ( + exports_index is not None and + self._conf == osetupcons.FileLocations.OVIRT_NFS_EXPORT_FILE and + not os.path.exists(self._conf) + ): + # This probably means that in a previous setup we added the path + # to /etc/exports instead of creating our own file in + # /etc/exports.d as we do now. Fix. The transactions below do + # not pass modifiedList nor do we call addChanges - we do not + # revert this fix on cleanup. + new_line = exports_content.pop(exports_index) + self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append( + filetransaction.FileTransaction( + name=osetupcons.FileLocations.NFS_EXPORT_FILE, + content=exports_content, + ) + ) + self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append( + filetransaction.FileTransaction( + name=self._conf, + content=[new_line], + ) + ) @plugin.event( stage=plugin.Stages.STAGE_CLOSEUP, -- To view, visit http://gerrit.ovirt.org/22617 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ebddd2de247fd5da88826710a6a2f8202b90d26 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yedidyah Bar David <d...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches