diff --git a/changelogs/fragments/66914-purefa_user_string.yaml b/changelogs/fragments/66914-purefa_user_string.yaml new file mode 100644 index 00000000000..16ff2dd3782 --- /dev/null +++ b/changelogs/fragments/66914-purefa_user_string.yaml @@ -0,0 +1,2 @@ +bugfixes: + - pure - fix incorrect user_string setting in module_utils file (https://github.com/ansible/ansible/pull/66914) diff --git a/lib/ansible/module_utils/pure.py b/lib/ansible/module_utils/pure.py index 9e94c3e6573..019c11add22 100644 --- a/lib/ansible/module_utils/pure.py +++ b/lib/ansible/module_utils/pure.py @@ -90,7 +90,8 @@ def get_blade(module): blade.disable_verify_ssl() try: blade.login(api) - if API_AGENT_VERSION in blade.api_version.list_versions().versions: + versions = blade.api_version.list_versions().versions + if API_AGENT_VERSION in versions: blade._api_client.user_agent = user_agent except rest.ApiException as e: module.fail_json(msg="Pure Storage FlashBlade authentication failed. Check your credentials") @@ -99,7 +100,8 @@ def get_blade(module): blade.disable_verify_ssl() try: blade.login(environ.get('PUREFB_API')) - if API_AGENT_VERSION in blade.api_version.list_versions().versions: + versions = blade.api_version.list_versions().versions + if API_AGENT_VERSION in versions: blade._api_client.user_agent = user_agent except rest.ApiException as e: module.fail_json(msg="Pure Storage FlashBlade authentication failed. Check your credentials")