From 63b1629d1134be59c6412bfd0cbc6cd861fad386 Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 26 Nov 2018 11:37:26 -0800 Subject: [PATCH] Remove bad network update calls on Ansible /cc @rambleraptor --- plugins/modules/gcp_compute_network.py | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/plugins/modules/gcp_compute_network.py b/plugins/modules/gcp_compute_network.py index cee686f..59f64b7 100644 --- a/plugins/modules/gcp_compute_network.py +++ b/plugins/modules/gcp_compute_network.py @@ -233,7 +233,7 @@ def main(): if fetch: if state == 'present': if is_different(module, fetch): - update(module, self_link(module), kind, fetch) + update(module, self_link(module), kind) fetch = fetch_resource(module, self_link(module), kind) changed = True else: @@ -257,31 +257,11 @@ def create(module, link, kind): return wait_for_operation(module, auth.post(link, resource_to_request(module))) -def update(module, link, kind, fetch): - update_fields(module, resource_to_request(module), - response_to_hash(module, fetch)) +def update(module, link, kind): auth = GcpSession(module, 'compute') return wait_for_operation(module, auth.patch(link, resource_to_request(module))) -def update_fields(module, request, response): - if response.get('routingConfig') != request.get('routingConfig'): - routing_config_update(module, request, response) - - -def routing_config_update(module, request, response): - auth = GcpSession(module, 'compute') - auth.patch( - ''.join([ - "https://www.googleapis.com/compute/v1/", - "projects/{project}/regions/{region}/subnetworks/{name}" - ]).format(**module.params), - { - u'routingConfig': NetworkRoutingconfigArray(module.params.get('routing_config', []), module).to_request() - } - ) - - def delete(module, link, kind): auth = GcpSession(module, 'compute') return wait_for_operation(module, auth.delete(link))