Fixed a bug where the Route 53 Health Check would add a new health check instead of updating an existing one when the user has > 100 health checks (#58539)

pull/59000/head
Mark Dierolf 5 years ago committed by Jill R
parent 9cb78b4826
commit 9fc710f657

@ -145,17 +145,25 @@ from ansible.module_utils.ec2 import ec2_argument_spec, get_aws_connection_info
# string_match if not previously enabled # string_match if not previously enabled
def find_health_check(conn, wanted): def find_health_check(conn, wanted):
"""Searches for health checks that have the exact same set of immutable values""" """Searches for health checks that have the exact same set of immutable values"""
for check in conn.get_list_health_checks().HealthChecks:
config = check.HealthCheckConfig results = conn.get_list_health_checks()
if (
config.get('IPAddress') == wanted.ip_addr and while True:
config.get('FullyQualifiedDomainName') == wanted.fqdn and for check in results.HealthChecks:
config.get('Type') == wanted.hc_type and config = check.HealthCheckConfig
config.get('RequestInterval') == str(wanted.request_interval) and if (
config.get('Port') == str(wanted.port) config.get('IPAddress') == wanted.ip_addr and
): config.get('FullyQualifiedDomainName') == wanted.fqdn and
return check config.get('Type') == wanted.hc_type and
return None config.get('RequestInterval') == str(wanted.request_interval) and
config.get('Port') == str(wanted.port)
):
return check
if (results.IsTruncated == 'true'):
results = conn.get_list_health_checks(marker=results.NextMarker)
else:
return None
def to_health_check(config): def to_health_check(config):

Loading…
Cancel
Save