From ed00696fde35057420795b58ecc5ab53197d902b Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Thu, 8 Dec 2016 16:15:14 +0100 Subject: [PATCH] minor --- plugins/iptables.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/iptables.py b/plugins/iptables.py index db85284..f6a62db 100644 --- a/plugins/iptables.py +++ b/plugins/iptables.py @@ -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,