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