Hello Yedidyah Bar David,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/18613

to review the following change.

Change subject: packaging: setup: do not delete iptables on cleanup
......................................................................

packaging: setup: do not delete iptables on cleanup

Prevent /etc/sysconfig/iptables from being deleted by cleanup after
it was updated by setup using otopi.

Change-Id: I03f6ea7050aa6dd27809738c588c9778aaa03bce
Signed-off-by: Yedidyah Bar David <[email protected]>
---
M packaging/setup/ovirt_engine_setup/constants.py
M packaging/setup/plugins/ovirt-engine-setup/network/firewall_manager.py
2 files changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/13/18613/1

diff --git a/packaging/setup/ovirt_engine_setup/constants.py 
b/packaging/setup/ovirt_engine_setup/constants.py
index 7078426..aa820ca 100644
--- a/packaging/setup/ovirt_engine_setup/constants.py
+++ b/packaging/setup/ovirt_engine_setup/constants.py
@@ -103,6 +103,12 @@
         'iptables.default.in'
     )
 
+    SYSCONFIG_IPTABLES = os.path.join(
+        SYSCONFDIR,
+        'sysconfig',
+        'iptables',
+    )
+
     OVIRT_FIREWALLD_CONFIG = os.path.join(
         OVIRT_ENGINE_DATADIR,
         'firewalld',
diff --git 
a/packaging/setup/plugins/ovirt-engine-setup/network/firewall_manager.py 
b/packaging/setup/plugins/ovirt-engine-setup/network/firewall_manager.py
index d347fb3..904da87 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/network/firewall_manager.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/network/firewall_manager.py
@@ -219,6 +219,16 @@
         self.environment[
             otopicons.NetEnv.IPTABLES_RULES
         ] = self._createIptablesConfig()
+        # This file is updated by otopi. Here we just prevent it from
+        # being deleted on cleanup.
+        # TODO: copy/move some uninstall code from the engine to otopi
+        # to allow just adding lines to iptables instead of replacing
+        # the file and also remove these lines on cleanup.
+        self.environment[
+            osetupcons.CoreEnv.UNINSTALL_UNREMOVABLE_FILES
+        ].append(
+            osetupcons.FileLocations.SYSCONFIG_IPTABLES,
+        )
 
         self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
             filetransaction.FileTransaction(


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I03f6ea7050aa6dd27809738c588c9778aaa03bce
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to