From e82a62b829e919a97be81fa84e3786dee9a0ab3a Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Fri, 6 Mar 2015 17:23:28 -0800 Subject: [PATCH] Adding fix for iptables --check that is currently in 2015.2 into develop. Adding a log entry for testing aggregating iptables rules, should show that the save function that writes to disk is only called once and only called when necessary. --- salt/modules/iptables.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/modules/iptables.py b/salt/modules/iptables.py index c55d77e495..ffb18fe0fa 100644 --- a/salt/modules/iptables.py +++ b/salt/modules/iptables.py @@ -17,6 +17,9 @@ import salt.utils from salt.state import STATE_INTERNAL_KEYWORDS as _STATE_INTERNAL_KEYWORDS from salt.exceptions import SaltException +import logging +log = logging.getLogger(__name__) + def __virtual__(): ''' @@ -427,6 +430,8 @@ def save(filename=None, family='ipv4'): if _conf() and not filename: filename = _conf(family) + log.debug('Saving rules to {0}'.format(filename)) + parent_dir = os.path.dirname(filename) if not os.path.isdir(parent_dir): os.makedirs(parent_dir)