Integration Test fixes for BucketAccessControl and SQL Database (#368)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2019-08-23 12:22:43 -07:00 committed by Alex Stephen
parent beab56c1e1
commit fa63f28139
6 changed files with 21 additions and 22 deletions

View file

@ -123,7 +123,7 @@ def main():
def collection(module):
res = {'project': module.params['project'], 'managed_zone': replace_resource_dict(module.params['managed_zone'], 'name')}
return "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managed_zone}/changes".format(**res)
return "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managed_zone}/rrsets".format(**res)
def fetch_list(module, link):

View file

@ -99,7 +99,7 @@ EXAMPLES = '''
gcp_sql_database:
name: test_object
charset: utf8
instance: "{{ instance }}"
instance: "{{ instance.name }}"
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"

View file

@ -53,7 +53,7 @@ extends_documentation_fragment: gcp
EXAMPLES = '''
- name: get info on a database
gcp_sql_database_info:
instance: "{{ instance }}"
instance: "{{ instance.name }}"
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"

View file

@ -120,7 +120,7 @@ EXAMPLES = '''
- name: create a bucket access control
gcp_storage_bucket_access_control:
bucket: test_object
bucket: "{{ bucket }}"
entity: user-alexstephen@google.com
role: WRITER
project: test_project
@ -220,10 +220,7 @@ def main():
state = module.params['state']
kind = 'storage#bucketAccessControl'
if module.params['id']:
fetch = fetch_resource(module, self_link(module), kind)
else:
fetch = {}
fetch = fetch_resource(module, self_link(module), kind)
changed = False
if fetch:
@ -286,11 +283,13 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module):
return "https://www.googleapis.com/storage/v1/b/{bucket}/acl/{entity}".format(**module.params)
res = {'bucket': replace_resource_dict(module.params['bucket'], 'name'), 'entity': module.params['entity']}
return "https://www.googleapis.com/storage/v1/b/{bucket}/acl/{entity}".format(**res)
def collection(module):
return "https://www.googleapis.com/storage/v1/b/{bucket}/acl".format(**module.params)
res = {'bucket': replace_resource_dict(module.params['bucket'], 'name')}
return "https://www.googleapis.com/storage/v1/b/{bucket}/acl".format(**res)
def return_if_object(module, response, kind, allow_not_found=False):