1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cs_user: fix return user_api_secret for ACS v4.10 and later (#36447)

This commit is contained in:
René Moser 2018-02-20 23:08:19 +01:00 committed by GitHub
parent 1720a210e9
commit 6402a3e504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -400,6 +400,13 @@ class AnsibleCloudStackUser(AnsibleCloudStack):
if value == user['accounttype']: if value == user['accounttype']:
self.result['account_type'] = key self.result['account_type'] = key
break break
# secretkey has been removed since CloudStack 4.10 from listUsers API
if self.module.params.get('keys_registered') and 'apikey' in user and 'secretkey' not in user:
user_keys = self.query_api('getUserKeys', id=user['id'])
if user_keys:
self.result['user_api_secret'] = user_keys['userkeys'].get('secretkey')
return self.result return self.result