Skip to content

Commit

Permalink
Make mqtt pass python3 sanity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mscherer authored and mattclay committed Dec 8, 2016
1 parent 3c1dea1 commit b902ea2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/ansible/modules/extras/notification/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@
/network/openvswitch_port.py
/notification/jabber.py
/notification/mail.py
/notification/mqtt.py

0 comments on commit b902ea2

Please sign in to comment.