Bug fixes for GCP modules (#60092)

This commit is contained in:
The Magician 2019-08-05 15:25:49 -07:00 committed by ansibot
parent de8d428157
commit 0234937ca3
20 changed files with 5 additions and 29 deletions

View file

@ -49,7 +49,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -49,7 +49,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -55,7 +55,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -49,7 +49,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -49,7 +49,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -186,8 +186,7 @@ def create(module, link):
def update(module, link):
delete(module, self_link(module))
create(module, collection(module))
module.fail_json(msg="Spanner objects can't be updated to ensure data safety")
def delete(module, link):

View file

@ -60,7 +60,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -202,8 +202,7 @@ def create(module, link):
def update(module, link):
auth = GcpSession(module, 'spanner')
return wait_for_operation(module, auth.patch(link, resource_to_update(module)))
module.fail_json(msg="Spanner objects can't be updated to ensure data safety")
def delete(module, link):

View file

@ -49,7 +49,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -187,8 +187,7 @@ def create(module, link, kind):
def update(module, link, kind):
auth = GcpSession(module, 'sql')
return wait_for_operation(module, auth.put(link, resource_to_request(module)))
module.fail_json(msg="SQL objects can't be updated to ensure data safety")
def delete(module, link, kind):

View file

@ -55,7 +55,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -763,8 +763,7 @@ def create(module, link, kind):
def update(module, link, kind, fetch):
auth = GcpSession(module, 'sql')
return wait_for_operation(module, auth.put(link, resource_to_request(module)))
module.fail_json(msg="SQL objects can't be updated to ensure data safety")
def delete(module, link, kind, fetch):

View file

@ -49,7 +49,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -215,7 +215,7 @@ def resource_to_request(module):
def unwrap_resource_filter(module):
return {'host': module.params['host'], 'name': module.params['name']}
return {'name': module.params['name'], 'host': module.params['host']}
def unwrap_resource(result, module):

View file

@ -60,7 +60,6 @@ EXAMPLES = '''
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
state: facts
'''
RETURN = '''

View file

@ -52,7 +52,6 @@
assert:
that:
- result.changed == true
- "result.kind == 'sql#database'"
- name: verify that database was created
gcp_sql_database_facts:
instance: "{{ instance }}"
@ -81,7 +80,6 @@
assert:
that:
- result.changed == false
- "result.kind == 'sql#database'"
#----------------------------------------------------------
- name: delete a database
gcp_sql_database:

View file

@ -47,7 +47,6 @@
assert:
that:
- result.changed == true
- "result.kind == 'sql#instance'"
- name: verify that instance was created
gcp_sql_instance_facts:
project: "{{ gcp_project }}"
@ -80,7 +79,6 @@
assert:
that:
- result.changed == false
- "result.kind == 'sql#instance'"
#----------------------------------------------------------
- name: delete a instance
gcp_sql_instance:

View file

@ -54,7 +54,6 @@
assert:
that:
- result.changed == true
- "result.kind == 'sql#user'"
- name: verify that user was created
gcp_sql_user_facts:
instance: "{{ instance }}"
@ -84,7 +83,6 @@
assert:
that:
- result.changed == false
- "result.kind == 'sql#user'"
#----------------------------------------------------------
- name: delete a user
gcp_sql_user:

View file

@ -33,7 +33,6 @@
assert:
that:
- result.changed == true
- "result.kind == 'storage#bucket'"
# ----------------------------------------------------------------------------
- name: create a bucket that already exists
gcp_storage_bucket:
@ -47,7 +46,6 @@
assert:
that:
- result.changed == false
- "result.kind == 'storage#bucket'"
#----------------------------------------------------------
- name: delete a bucket
gcp_storage_bucket:

View file

@ -45,7 +45,6 @@
assert:
that:
- result.changed == true
- "result.kind == 'storage#bucketAccessControl'"
# ----------------------------------------------------------------------------
- name: create a bucket access control that already exists
gcp_storage_bucket_access_control:
@ -61,7 +60,6 @@
assert:
that:
- result.changed == false
- "result.kind == 'storage#bucketAccessControl'"
#----------------------------------------------------------
- name: delete a bucket access control
gcp_storage_bucket_access_control: