mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-06 10:50:28 -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 state == 'present':
|
||||
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)
|
||||
changed = True
|
||||
else:
|
||||
|
@ -1139,7 +1139,8 @@ def create(module, link, kind):
|
|||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
@ -1151,8 +1152,13 @@ def update_fields(module, request, response):
|
|||
def machine_type_update(module, request, response):
|
||||
auth = GcpSession(module, 'compute')
|
||||
auth.post(
|
||||
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/instances/{name}/setMachineType"]).format(**module.params),
|
||||
{u'machineType': machine_type_selflink(module.params.get('machine_type'), module.params)},
|
||||
''.join([
|
||||
"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