mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Fixed iptables on non-RedHat systems
1aa4044a8a
, among other things, made a change that results in "local
variable 'out' referenced before assignment" on all non-RedHat systems
that attempt to add an iptables rule. I don't understand the reason for
the change; most likely it was an error. Changing it back.
This commit is contained in:
parent
24bcad08f5
commit
f4bea9a815
@ -272,8 +272,8 @@ def check(table='filter', chain=None, rule=None):
|
|||||||
if __grains__['os_family'] == 'RedHat':
|
if __grains__['os_family'] == 'RedHat':
|
||||||
cmd = 'iptables-save'
|
cmd = 'iptables-save'
|
||||||
out = __salt__['cmd.run'](cmd).find('-A {1} {2}'.format(table, chain, rule))
|
out = __salt__['cmd.run'](cmd).find('-A {1} {2}'.format(table, chain, rule))
|
||||||
if out != -1:
|
if out != -1:
|
||||||
out = ''
|
out = ''
|
||||||
else:
|
else:
|
||||||
cmd = 'iptables -t {0} -C {1} {2}'.format(table, chain, rule)
|
cmd = 'iptables -t {0} -C {1} {2}'.format(table, chain, rule)
|
||||||
out = __salt__['cmd.run'](cmd)
|
out = __salt__['cmd.run'](cmd)
|
||||||
|
Loading…
Reference in New Issue
Block a user