From efe82efb32e1045a73c4776d299d0ce9a6b944e6 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 17 Oct 2016 16:22:02 +0200 Subject: [PATCH] Make mqtt pass python3 sanity tests --- notification/mqtt.py | 4 +++- test/utils/shippable/sanity-skip-python3.txt | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/notification/mqtt.py b/notification/mqtt.py index 14713c2b1ea..89fa50a7dbd 100644 --- a/notification/mqtt.py +++ b/notification/mqtt.py @@ -156,11 +156,13 @@ def main(): hostname=server, port=port, auth=auth) - except Exception, e: + except Exception: + e = get_exception() module.fail_json(msg="unable to publish to MQTT broker %s" % (e)) module.exit_json(changed=False, topic=topic) # import module snippets from ansible.module_utils.basic import * +from ansible.module_utils.pycompat24 import get_exception main() diff --git a/test/utils/shippable/sanity-skip-python3.txt b/test/utils/shippable/sanity-skip-python3.txt index 2674bf0584a..bfeeff78744 100644 --- a/test/utils/shippable/sanity-skip-python3.txt +++ b/test/utils/shippable/sanity-skip-python3.txt @@ -66,4 +66,3 @@ /network/openvswitch_port.py /notification/jabber.py /notification/mail.py -/notification/mqtt.py