From 992f4468d648ddcad39631215dccde2ce627a09a Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Fri, 5 Oct 2018 21:02:44 +1000 Subject: [PATCH] azure_rm_common: use __version__ from module_util (#46184) (cherry picked from commit 02c11e6b51ff8fd19523f2dbf9c25eb51f39778e) --- changelogs/fragments/azure-version.yaml | 2 ++ lib/ansible/module_utils/azure_rm_common.py | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/azure-version.yaml diff --git a/changelogs/fragments/azure-version.yaml b/changelogs/fragments/azure-version.yaml new file mode 100644 index 00000000000..6939342cf5d --- /dev/null +++ b/changelogs/fragments/azure-version.yaml @@ -0,0 +1,2 @@ +bugfixes: +- use proper module_util to get Ansible version for Azure requests diff --git a/lib/ansible/module_utils/azure_rm_common.py b/lib/ansible/module_utils/azure_rm_common.py index e0b89620cde..4c6f8801a19 100644 --- a/lib/ansible/module_utils/azure_rm_common.py +++ b/lib/ansible/module_utils/azure_rm_common.py @@ -13,12 +13,9 @@ import traceback from os.path import expanduser from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.ansible_release import __version__ as ANSIBLE_VERSION from ansible.module_utils.six.moves import configparser import ansible.module_utils.six.moves.urllib.parse as urlparse -try: - from ansible.release import __version__ as ANSIBLE_VERSION -except ImportError: - ANSIBLE_VERSION = 'unknown' AZURE_COMMON_ARGS = dict( auth_source=dict(