From d4157095f3b31db255258868722c741f33cbbce4 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 17 Oct 2016 15:36:09 +0200 Subject: [PATCH] Make bigpanda module pass python3 sanity check --- lib/ansible/modules/extras/monitoring/bigpanda.py | 4 +++- .../extras/test/utils/shippable/sanity-skip-python3.txt | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/monitoring/bigpanda.py b/lib/ansible/modules/extras/monitoring/bigpanda.py index 80bb5aec947..86b64762772 100644 --- a/lib/ansible/modules/extras/monitoring/bigpanda.py +++ b/lib/ansible/modules/extras/monitoring/bigpanda.py @@ -170,11 +170,13 @@ def main(): module.exit_json(changed=True, **deployment) else: module.fail_json(msg=json.dumps(info)) - except Exception, e: + except Exception: + e = get_exception() module.fail_json(msg=str(e)) # import module snippets from ansible.module_utils.basic import * from ansible.module_utils.urls import * +from ansible.module_utils.pycompat24 import get_exception if __name__ == '__main__': 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 052bf355ca0..a15dd20926e 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 @@ -45,7 +45,6 @@ /database/vertica/vertica_role.py /database/vertica/vertica_schema.py /database/vertica/vertica_user.py -/monitoring/bigpanda.py /monitoring/boundary_meter.py /monitoring/circonus_annotation.py /monitoring/datadog_monitor.py