mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Fixed iptables.save module to not fail when parent directory already exists.
This commit is contained in:
parent
c8571a5255
commit
e901ae3b14
@ -124,7 +124,9 @@ def save(filename):
|
||||
|
||||
salt '*' iptables.save /etc/sysconfig/iptables
|
||||
'''
|
||||
os.makedirs(os.path.dirname(filename))
|
||||
parent_dir = os.path.dirname(filename)
|
||||
if not os.path.isdir(parent_dir):
|
||||
os.makedirs(parent_dir)
|
||||
cmd = 'iptables-save > {0}'.format(filename)
|
||||
out = __salt__['cmd.run'](cmd)
|
||||
return out
|
||||
|
Loading…
Reference in New Issue
Block a user