[node-patches] Change in ovirt-node[master]: firewall: Convenience function
fabiand at redhat.com
fabiand at redhat.com
Wed Sep 3 15:49:26 UTC 2014
Fabian Deutsch has uploaded a new change for review.
Change subject: firewall: Convenience function
......................................................................
firewall: Convenience function
… to hide the implementation
Change-Id: Ie1db01f4cca3e5cea638e4db6a504a843ec60b97
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/utils/firewall.py
1 file changed, 8 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/15/32415/1
diff --git a/src/ovirt/node/utils/firewall.py b/src/ovirt/node/utils/firewall.py
index ab5633a..98b5bed 100644
--- a/src/ovirt/node/utils/firewall.py
+++ b/src/ovirt/node/utils/firewall.py
@@ -49,6 +49,13 @@
return False
+def open_port(port, proto):
+ if is_firewalld():
+ setup_firewalld(port, proto)
+ else
+ setup_iptables(port, proto)
+
+
def setup_iptables(port, proto):
rules = "/etc/sysconfig/iptables"
@@ -116,10 +123,7 @@
for i in fw_conf:
LOGGER.debug("Opening firewall ports: %s" % str(i))
port, proto = i
- if is_firewalld():
- setup_firewalld(port, proto)
- else:
- setup_iptables(port, proto)
+ open_port(port, proto)
if __name__ == "__main__":
--
To view, visit http://gerrit.ovirt.org/32415
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1db01f4cca3e5cea638e4db6a504a843ec60b97
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
More information about the node-patches
mailing list