diff --git a/lib/ansible/modules/clustering/consul.py b/lib/ansible/modules/clustering/consul.py index aeb8787446..72dc892ea2 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'):