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: