From ab7c850360e6369308fc94ec82022542871cadd1 Mon Sep 17 00:00:00 2001 From: William Griffiths Date: Sun, 10 Sep 2017 02:41:08 +0100 Subject: [PATCH] consul + Python 3.5 (#23935) * Fix #23934 - consul + Python 3.5 * List comprehension instead of filter with lambda --- lib/ansible/modules/clustering/consul.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/clustering/consul.py b/lib/ansible/modules/clustering/consul.py index aeb87874465..72dc892ea22 100644 --- a/lib/ansible/modules/clustering/consul.py +++ b/lib/ansible/modules/clustering/consul.py @@ -359,9 +359,9 @@ def get_service_by_id_or_name(consul_api, service_id_or_name): def parse_check(module): - if len(filter(None, [module.params.get('script'), module.params.get('ttl'), module.params.get('http')])) > 1: + if len([p for p in (module.params.get('script'), module.params.get('ttl'), module.params.get('http')) if p]) > 1: module.fail_json( - msg='check are either script, http or ttl driven, supplying more than one does not make sense') + msg='checks are either script, http or ttl driven, supplying more than one does not make sense') if module.params.get('check_id') or module.params.get('script') or module.params.get('ttl') or module.params.get('http'):