This commit is contained in:
Stefan Midjich 2016-12-08 16:15:14 +01:00
parent c91a969b27
commit ed00696fde

View file

@ -88,9 +88,6 @@ def run(arg):
try:
# The two arguments must not contain spaces of course.
rc = sudo(tuple(iptables_cmd.split(' ')), _out=output, _err=error)
if rc.exit_code == 0:
l.debug('Created iptables IP rule successfully')
except ErrorReturnCode:
error.seek(0)
error_msg = error.read()
@ -109,6 +106,9 @@ def run(arg):
iptables_failed = True
pass
if rc.exit_code == 0:
l.debug('Created iptables IP rule successfully')
# If all else fails, error! This will be shown to end users.
return {
'error': error_msg,