From 5b408a490d5f40b0b36da4da6701725475a3d1da Mon Sep 17 00:00:00 2001 From: Alex Stephen Date: Fri, 6 Dec 2019 22:32:46 +0000 Subject: [PATCH] Moving Ansible fingerprint to match TF Signed-off-by: Modular Magician --- plugins/modules/gcp_compute_subnetwork.py | 16 +++------------- plugins/modules/gcp_compute_subnetwork_info.py | 6 ------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/plugins/modules/gcp_compute_subnetwork.py b/plugins/modules/gcp_compute_subnetwork.py index 871d13b..bfa4d93 100644 --- a/plugins/modules/gcp_compute_subnetwork.py +++ b/plugins/modules/gcp_compute_subnetwork.py @@ -257,12 +257,6 @@ network: - Only networks that are in the distributed mode can have subnetworks. returned: success type: dict -fingerprint: - description: - - Fingerprint of this resource. This field is used internally during updates of - this resource. - returned: success - type: str secondaryIpRanges: description: - An array of configurations for secondary IP ranges for VM instances contained @@ -382,7 +376,7 @@ def update_fields(module, request, response): if response.get('ipCidrRange') != request.get('ipCidrRange'): ip_cidr_range_update(module, request, response) if response.get('secondaryIpRanges') != request.get('secondaryIpRanges'): - fingerprint_update(module, request, response) + secondary_ip_ranges_update(module, request, response) if response.get('privateIpGoogleAccess') != request.get('privateIpGoogleAccess'): private_ip_google_access_update(module, request, response) @@ -395,14 +389,11 @@ def ip_cidr_range_update(module, request, response): ) -def fingerprint_update(module, request, response): +def secondary_ip_ranges_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'fingerprint': response.get('fingerprint'), - u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request(), - }, + {u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request()}, ) @@ -503,7 +494,6 @@ def response_to_hash(module, response): u'ipCidrRange': response.get(u'ipCidrRange'), u'name': response.get(u'name'), u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'), - u'fingerprint': response.get(u'fingerprint'), u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(response.get(u'secondaryIpRanges', []), module).from_response(), u'privateIpGoogleAccess': response.get(u'privateIpGoogleAccess'), u'region': module.params.get('region'), diff --git a/plugins/modules/gcp_compute_subnetwork_info.py b/plugins/modules/gcp_compute_subnetwork_info.py index 149d653..e46966e 100644 --- a/plugins/modules/gcp_compute_subnetwork_info.py +++ b/plugins/modules/gcp_compute_subnetwork_info.py @@ -164,12 +164,6 @@ resources: - Only networks that are in the distributed mode can have subnetworks. returned: success type: dict - fingerprint: - description: - - Fingerprint of this resource. This field is used internally during updates - of this resource. - returned: success - type: str secondaryIpRanges: description: - An array of configurations for secondary IP ranges for VM instances contained