diff --git a/lib/ansible/modules/web_infrastructure/htpasswd.py b/lib/ansible/modules/web_infrastructure/htpasswd.py index 83a6445374..d4d950e924 100644 --- a/lib/ansible/modules/web_infrastructure/htpasswd.py +++ b/lib/ansible/modules/web_infrastructure/htpasswd.py @@ -251,7 +251,8 @@ def main(): check_file_attrs(module, changed, msg) module.exit_json(msg=msg, changed=changed) - except Exception, e: + except Exception: + e = get_exception() module.fail_json(msg=str(e))