mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-07 03:10:30 -07:00
Ansible: Auth fix for scopes (#140)
<!-- This change is generated by MagicModules. --> /cc @rambleraptor
This commit is contained in:
parent
39fe1760be
commit
5ce2906429
1 changed files with 0 additions and 3 deletions
|
@ -149,9 +149,6 @@ class GcpSession(object):
|
|||
elif cred_type == 'serviceaccount' and self.module.params.get('service_account_file'):
|
||||
path = os.path.realpath(os.path.expanduser(self.module.params['service_account_file']))
|
||||
return service_account.Credentials.from_service_account_file(path).with_scopes(self.module.params['scopes'])
|
||||
elif cred_type == 'serviceaccount' and self.module.params.get('service_account_contents'):
|
||||
cred = json.loads(self.module.params.get('service_account_contents'))
|
||||
return service_account.Credentials.from_service_account_info(cred).with_scopes(self.module.params['scopes'])
|
||||
elif cred_type == 'machineaccount':
|
||||
return google.auth.compute_engine.Credentials(
|
||||
self.module.params['service_account_email'])
|
||||
|
|
Loading…
Add table
Reference in a new issue