Simone Tiraboschi has uploaded a new change for review. Change subject: packaging: setup: keeping NFS ports open in case of preexisting exports ......................................................................
packaging: setup: keeping NFS ports open in case of preexisting exports Looking for preexisting NFS exports in order to correctly evaluate how to configure NFS related rules on the firewall. Change-Id: Id99ac88af780c6239655676b5290230076d0284b Bug-Url: https://bugzilla.redhat.com/1109326 Signed-off-by: Simone Tiraboschi <[email protected]> --- M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py 1 file changed, 21 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/44/33344/1 diff --git a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py index 2bd9fbb..8cc3d05 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py +++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py @@ -84,6 +84,13 @@ ) self._enabled = True + self._foundpreextnfs = False + + @plugin.event( + stage=plugin.Stages.STAGE_PROGRAMS, + ) + def _programs(self): + self.command.detect('exportfs') @plugin.event( stage=plugin.Stages.STAGE_LATE_SETUP, @@ -125,6 +132,17 @@ self.environment[ osetupcons.SystemEnv.NFS_CONFIG_ENABLED_LEGACY_IN_POSTINSTALL ] = False + + rc, stdout, stderr = self.execute( + ( + self.command.get('exportfs'), + ), + raiseOnError=False, + ) + if rc == 0: + for line in stdout: + if line[0] == '/': + self._foundpreextnfs = True @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, @@ -182,7 +200,9 @@ osetupcons.Stages.SYSTEM_NFS_CONFIG_AVAILABLE, ), # must be run before firewall_manager plugin - condition=lambda self: self._enabled + condition=lambda self: ( + self._enabled or self._foundpreextnfs + ), # must be always enabled to create examples ) def _firewall(self): -- To view, visit http://gerrit.ovirt.org/33344 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id99ac88af780c6239655676b5290230076d0284b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.4 Gerrit-Owner: Simone Tiraboschi <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
