From 5b7d161b108393a3bc2f3e9d759e209cca0aafe3 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 19 Oct 2017 14:09:06 -0700 Subject: [PATCH] firewalld: don't reference undefined variable in error case (#31949) * firewalld: don't reference undefined variable in error case Signed-off-by: Adam Miller * firewalld: don't set exception as var and not use it Signed-off-by: Adam Miller --- lib/ansible/modules/system/firewalld.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/system/firewalld.py b/lib/ansible/modules/system/firewalld.py index ff54f57571..65795ca410 100644 --- a/lib/ansible/modules/system/firewalld.py +++ b/lib/ansible/modules/system/firewalld.py @@ -169,7 +169,7 @@ try: fw.start() fw_offline = True -except ImportError as e: +except ImportError: import_failure = True @@ -751,8 +751,7 @@ def main(): if import_failure: module.fail_json( - msg='firewalld and its python 2 module are required for this module, version 2.0.11 or newer required (3.0.9 or newer for offline operations) \n %s' - % e + msg='firewalld and its python 2 module are required for this module, version 2.0.11 or newer required (3.0.9 or newer for offline operations)' ) if fw_offline: