Moving Ansible fingerprint to match TF (#102)

Moving Ansible fingerprint to match TF
This commit is contained in:
Alex Stephen 2019-12-06 15:37:15 -08:00 committed by GitHub
commit 561dddd734
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 19 deletions

View file

@ -257,12 +257,6 @@ network:
- Only networks that are in the distributed mode can have subnetworks. - Only networks that are in the distributed mode can have subnetworks.
returned: success returned: success
type: dict type: dict
fingerprint:
description:
- Fingerprint of this resource. This field is used internally during updates of
this resource.
returned: success
type: str
secondaryIpRanges: secondaryIpRanges:
description: description:
- An array of configurations for secondary IP ranges for VM instances contained - 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'): if response.get('ipCidrRange') != request.get('ipCidrRange'):
ip_cidr_range_update(module, request, response) ip_cidr_range_update(module, request, response)
if response.get('secondaryIpRanges') != request.get('secondaryIpRanges'): 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'): if response.get('privateIpGoogleAccess') != request.get('privateIpGoogleAccess'):
private_ip_google_access_update(module, request, response) 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 = GcpSession(module, 'compute')
auth.patch( auth.patch(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params), ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params),
{ {u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request()},
u'fingerprint': response.get('fingerprint'),
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'ipCidrRange': response.get(u'ipCidrRange'),
u'name': response.get(u'name'), u'name': response.get(u'name'),
u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'), 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'secondaryIpRanges': SubnetworkSecondaryiprangesArray(response.get(u'secondaryIpRanges', []), module).from_response(),
u'privateIpGoogleAccess': response.get(u'privateIpGoogleAccess'), u'privateIpGoogleAccess': response.get(u'privateIpGoogleAccess'),
u'region': module.params.get('region'), u'region': module.params.get('region'),

View file

@ -164,12 +164,6 @@ resources:
- Only networks that are in the distributed mode can have subnetworks. - Only networks that are in the distributed mode can have subnetworks.
returned: success returned: success
type: dict type: dict
fingerprint:
description:
- Fingerprint of this resource. This field is used internally during updates
of this resource.
returned: success
type: str
secondaryIpRanges: secondaryIpRanges:
description: description:
- An array of configurations for secondary IP ranges for VM instances contained - An array of configurations for secondary IP ranges for VM instances contained