mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
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.
This commit is contained in:
parent
ad7c0bb26d
commit
e82a62b829
@ -17,6 +17,9 @@ import salt.utils
|
|||||||
from salt.state import STATE_INTERNAL_KEYWORDS as _STATE_INTERNAL_KEYWORDS
|
from salt.state import STATE_INTERNAL_KEYWORDS as _STATE_INTERNAL_KEYWORDS
|
||||||
from salt.exceptions import SaltException
|
from salt.exceptions import SaltException
|
||||||
|
|
||||||
|
import logging
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def __virtual__():
|
def __virtual__():
|
||||||
'''
|
'''
|
||||||
@ -427,6 +430,8 @@ def save(filename=None, family='ipv4'):
|
|||||||
if _conf() and not filename:
|
if _conf() and not filename:
|
||||||
filename = _conf(family)
|
filename = _conf(family)
|
||||||
|
|
||||||
|
log.debug('Saving rules to {0}'.format(filename))
|
||||||
|
|
||||||
parent_dir = os.path.dirname(filename)
|
parent_dir = os.path.dirname(filename)
|
||||||
if not os.path.isdir(parent_dir):
|
if not os.path.isdir(parent_dir):
|
||||||
os.makedirs(parent_dir)
|
os.makedirs(parent_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user