From e49f15d6e4d735ba6f58e3e15b2353e4781c7e6b Mon Sep 17 00:00:00 2001 From: Josh Souza Date: Tue, 27 Jun 2017 13:58:21 -0600 Subject: [PATCH] [cloud] Fix logical flaw in route53_health_check, use string ports everywhere (#25706) * Fix logical flaw (update when diff), use string ports everywhere * Change port comparison to integer vs. string The comparison works either way as long as it's consistent. Boto docs state that it takes in an integer, but if given a string apparently keeps it as such. This change just ensures that when we compare, we specifically deal with integers. --- lib/ansible/modules/cloud/amazon/route53_health_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/route53_health_check.py b/lib/ansible/modules/cloud/amazon/route53_health_check.py index e97ffb653a1..779a3f9550c 100644 --- a/lib/ansible/modules/cloud/amazon/route53_health_check.py +++ b/lib/ansible/modules/cloud/amazon/route53_health_check.py @@ -169,7 +169,7 @@ def find_health_check(conn, wanted): def to_health_check(config): return HealthCheck( config.get('IPAddress'), - config.get('Port'), + int(config.get('Port')), config.get('Type'), config.get('ResourcePath'), fqdn=config.get('FullyQualifiedDomainName'), @@ -352,7 +352,7 @@ def main(): changed = True else: diff = health_check_diff(existing_config, wanted_config) - if not diff: + if diff: action = "update" update_health_check(conn, existing_check.Id, int(existing_check.HealthCheckVersion), wanted_config) changed = True