From cc50b803df5fa466aa0bfa45a3d080f82c8e0b6d Mon Sep 17 00:00:00 2001 From: mjfroehlich Date: Wed, 22 Mar 2017 17:49:39 +0100 Subject: [PATCH] [cloud][route53_health_check] Consider port in identity test (#22762) Allows to health-check two services on one host. Before, asking for 2 health checks being present for `http://myhost:8888` and `http://myhost:9999` resulted in just a single health check, as this module considered the two specs as equal. Bonus: route53_health_check now passes style guidelines --- lib/ansible/modules/cloud/amazon/route53_health_check.py | 8 +++++++- test/sanity/pep8/legacy-files.txt | 1 - 2 files changed, 7 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 f8bbc97784d..e97ffb653a1 100644 --- a/lib/ansible/modules/cloud/amazon/route53_health_check.py +++ b/lib/ansible/modules/cloud/amazon/route53_health_check.py @@ -156,7 +156,13 @@ def find_health_check(conn, wanted): """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 - if config.get('IPAddress') == wanted.ip_addr and config.get('FullyQualifiedDomainName') == wanted.fqdn and config.get('Type') == wanted.hc_type and config.get('RequestInterval') == str(wanted.request_interval): + if ( + config.get('IPAddress') == wanted.ip_addr and + config.get('FullyQualifiedDomainName') == wanted.fqdn and + config.get('Type') == wanted.hc_type and + config.get('RequestInterval') == str(wanted.request_interval) and + config.get('Port') == str(wanted.port) + ): return check return None diff --git a/test/sanity/pep8/legacy-files.txt b/test/sanity/pep8/legacy-files.txt index e2f5c7ae9bb..a4168885095 100644 --- a/test/sanity/pep8/legacy-files.txt +++ b/test/sanity/pep8/legacy-files.txt @@ -53,7 +53,6 @@ lib/ansible/modules/cloud/amazon/rds_param_group.py lib/ansible/modules/cloud/amazon/rds_subnet_group.py lib/ansible/modules/cloud/amazon/redshift.py lib/ansible/modules/cloud/amazon/route53.py -lib/ansible/modules/cloud/amazon/route53_health_check.py lib/ansible/modules/cloud/amazon/s3.py lib/ansible/modules/cloud/amazon/s3_lifecycle.py lib/ansible/modules/cloud/amazon/s3_sync.py