Fix user_agent string not getting set (#66914)

pull/67005/head
Simon Dodsley 5 years ago committed by GitHub
parent 9db0fb785d
commit 26175178ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- pure - fix incorrect user_string setting in module_utils file (https://github.com/ansible/ansible/pull/66914)

@ -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")

Loading…
Cancel
Save