Bug fixes for GCP modules (#65445)
This commit is contained in:
parent
5bc11caa92
commit
d37f00df9b
3 changed files with 15 additions and 7 deletions
|
@ -89,7 +89,7 @@ options:
|
||||||
type: str
|
type: str
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The ID of the instance or a fully qualified identifier for the instance. .
|
- The ID of the instance or a fully qualified identifier for the instance.
|
||||||
required: true
|
required: true
|
||||||
type: str
|
type: str
|
||||||
memory_size_gb:
|
memory_size_gb:
|
||||||
|
@ -267,7 +267,7 @@ locationId:
|
||||||
type: str
|
type: str
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The ID of the instance or a fully qualified identifier for the instance. .
|
- The ID of the instance or a fully qualified identifier for the instance.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
memorySizeGb:
|
memorySizeGb:
|
||||||
|
|
|
@ -172,7 +172,7 @@ resources:
|
||||||
type: str
|
type: str
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- The ID of the instance or a fully qualified identifier for the instance. .
|
- The ID of the instance or a fully qualified identifier for the instance.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
memorySizeGb:
|
memorySizeGb:
|
||||||
|
|
|
@ -166,7 +166,7 @@ def main():
|
||||||
if fetch:
|
if fetch:
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
if is_different(module, fetch):
|
if is_different(module, fetch):
|
||||||
update(module, self_link(module))
|
update(module, self_link(module), fetch)
|
||||||
fetch = fetch_resource(module, self_link(module))
|
fetch = fetch_resource(module, self_link(module))
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
|
@ -190,9 +190,17 @@ def create(module, link):
|
||||||
return return_if_object(module, auth.post(link, resource_to_request(module)))
|
return return_if_object(module, auth.post(link, resource_to_request(module)))
|
||||||
|
|
||||||
|
|
||||||
def update(module, link):
|
def update(module, link, fetch):
|
||||||
delete(module, self_link(module))
|
auth = GcpSession(module, 'sourcerepo')
|
||||||
create(module, collection(module))
|
params = {'updateMask': updateMask(resource_to_request(module), response_to_hash(module, fetch))}
|
||||||
|
request = resource_to_request(module)
|
||||||
|
del request['name']
|
||||||
|
return return_if_object(module, auth.patch(link, request, params=params))
|
||||||
|
|
||||||
|
|
||||||
|
def updateMask(request, response):
|
||||||
|
update_mask = []
|
||||||
|
return ','.join(update_mask)
|
||||||
|
|
||||||
|
|
||||||
def delete(module, link):
|
def delete(module, link):
|
||||||
|
|
Loading…
Reference in a new issue