diff --git a/lib/ansible/modules/extras/notification/jabber.py b/lib/ansible/modules/extras/notification/jabber.py index 840954658f..02751e9350 100644 --- a/lib/ansible/modules/extras/notification/jabber.py +++ b/lib/ansible/modules/extras/notification/jabber.py @@ -155,11 +155,13 @@ def main(): conn.send(msg) time.sleep(1) conn.disconnect() - except Exception, e: + except Exception: + e = get_exception() module.fail_json(msg="unable to send msg: %s" % e) module.exit_json(changed=False, to=to, user=user, msg=msg.getBody()) # import module snippets from ansible.module_utils.basic import * +from ansible.module_utils.pycompat24 import get_exception main() diff --git a/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python3.txt b/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python3.txt index 24f1bbbc67..052bf355ca 100644 --- a/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python3.txt +++ b/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python3.txt @@ -58,4 +58,3 @@ /network/nmcli.py /network/openvswitch_bridge.py /network/openvswitch_port.py -/notification/jabber.py