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:
Antonis Christofides 2013-11-08 18:02:04 +02:00
parent 24bcad08f5
commit f4bea9a815

View File

@ -272,8 +272,8 @@ def check(table='filter', chain=None, rule=None):
if __grains__['os_family'] == 'RedHat':
cmd = 'iptables-save'
out = __salt__['cmd.run'](cmd).find('-A {1} {2}'.format(table, chain, rule))
if out != -1:
out = ''
if out != -1:
out = ''
else:
cmd = 'iptables -t {0} -C {1} {2}'.format(table, chain, rule)
out = __salt__['cmd.run'](cmd)