mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-09 04:10:27 -07:00
Magic Modules changes. (#101)
This commit is contained in:
parent
87c61abfb3
commit
0c291d57cd
1 changed files with 10 additions and 4 deletions
|
@ -1109,7 +1109,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), kind)
|
update(module, self_link(module), kind, fetch)
|
||||||
fetch = fetch_resource(module, self_link(module), kind)
|
fetch = fetch_resource(module, self_link(module), kind)
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
|
@ -1139,7 +1139,8 @@ def create(module, link, kind):
|
||||||
|
|
||||||
|
|
||||||
def update(module, link, kind, fetch):
|
def update(module, link, kind, fetch):
|
||||||
update_fields(module, resource_to_request(module), response_to_hash(module, fetch))
|
update_fields(module, resource_to_request(module),
|
||||||
|
response_to_hash(module, fetch))
|
||||||
return fetch_resource(module, self_link(module), kind)
|
return fetch_resource(module, self_link(module), kind)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1151,8 +1152,13 @@ def update_fields(module, request, response):
|
||||||
def machine_type_update(module, request, response):
|
def machine_type_update(module, request, response):
|
||||||
auth = GcpSession(module, 'compute')
|
auth = GcpSession(module, 'compute')
|
||||||
auth.post(
|
auth.post(
|
||||||
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/instances/{name}/setMachineType"]).format(**module.params),
|
''.join([
|
||||||
{u'machineType': machine_type_selflink(module.params.get('machine_type'), module.params)},
|
"https://www.googleapis.com/compute/v1/",
|
||||||
|
"projdcts/{project}/zones/{zone}/instances/{name}/setMachineType"
|
||||||
|
]).format(**module.params),
|
||||||
|
{
|
||||||
|
u'machineType': machine_type_selflink(module.params.get('machine_type'), module.params)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue