mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-06-27 03:00:20 -07:00
Test Fixes (#299)
Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
697908c7fe
commit
5b92781ab0
45 changed files with 19 additions and 96 deletions
|
@ -61,7 +61,7 @@ extends_documentation_fragment: gcp
|
|||
EXAMPLES = '''
|
||||
- name: create a service account
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
name: sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: test_project
|
||||
auth_kind: serviceaccount
|
||||
|
|
|
@ -108,8 +108,8 @@ def main():
|
|||
module.params['scopes'] = ['https://www.googleapis.com/auth/iam']
|
||||
|
||||
items = fetch_list(module, collection(module))
|
||||
if items.get('items'):
|
||||
items = items.get('items')
|
||||
if items.get('accounts'):
|
||||
items = items.get('accounts')
|
||||
else:
|
||||
items = []
|
||||
return_value = {'resources': items}
|
||||
|
|
|
@ -484,7 +484,11 @@ def decode_request(response, module):
|
|||
|
||||
|
||||
def encode_request(request, module):
|
||||
request['topic'] = '/'.join(['projects', module.params['project'], 'topics', replace_resource_dict(request['topic'], 'name')])
|
||||
if isinstance(module.params.get('topic'), dict):
|
||||
request['topic'] = '/'.join(['projects', module.params['project'], 'topics', replace_resource_dict(module.params.get(u'topic', {}), 'name')])
|
||||
else:
|
||||
request['topic'] = '/'.join(['projects', module.params['project'], 'topics', module.params['topic']])
|
||||
|
||||
request['name'] = '/'.join(['projects', module.params['project'], 'subscriptions', module.params['name']])
|
||||
|
||||
return request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue