cs_user: fix return user_api_secret for ACS v4.10 and later (#36447)
This commit is contained in:
parent
1720a210e9
commit
6402a3e504
1 changed files with 7 additions and 0 deletions
|
@ -400,6 +400,13 @@ class AnsibleCloudStackUser(AnsibleCloudStack):
|
|||
if value == user['accounttype']:
|
||||
self.result['account_type'] = key
|
||||
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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue