[node-patches] Change in ovirt-node[master]: Prevent adding iptable rule on every run.

tlitovsk at redhat.com tlitovsk at redhat.com
Tue Nov 3 13:36:45 UTC 2015


Anatoly Litovsky has uploaded a new change for review.

Change subject: Prevent adding iptable rule on every run.
......................................................................

Prevent adding iptable rule on every run.

if iptables list is empty a rule will be added to /etc/sysconfig/iptables
We need this rule to be added only once .
Therefor we will load the table before checking
if we need to add the rule.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1221999

Change-Id: Ibe3e80834b9fe817b395793d1a2d02db0c206c4f
Signed-off-by: Tolik Litovsky <tlitovsk at redhat.com>
---
M src/ovirt/node/utils/firewall.py
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/15/48015/1

diff --git a/src/ovirt/node/utils/firewall.py b/src/ovirt/node/utils/firewall.py
index 260c635..c539d14 100644
--- a/src/ovirt/node/utils/firewall.py
+++ b/src/ovirt/node/utils/firewall.py
@@ -92,10 +92,11 @@
 
         fs.Config().persist(rules)
 
+
+    # We need to load the rules before, to prevent overwriting them
+    # when they weren't loaded.
+    load_rules()
     if not is_open():
-        # We need to load the rules before, to prevent overwriting them
-        # when they weren't loaded.
-        load_rules()
         open_port()
         save_rules()
 


-- 
To view, visit https://gerrit.ovirt.org/48015
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe3e80834b9fe817b395793d1a2d02db0c206c4f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Anatoly Litovsky <tlitovsk at redhat.com>



More information about the node-patches mailing list