From d312f8115d6a46b65e413a4db07cba2bae565cfb Mon Sep 17 00:00:00 2001 From: Tobias Florek Date: Wed, 11 Nov 2015 09:19:42 +0100 Subject: oo_filter: don't fail when attribute is not defined --- filter_plugins/oo_filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index f4643270d..9a17913c4 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -275,7 +275,7 @@ class FilterModule(object): raise errors.AnsibleFilterError("|failed expects filter_attr is a str") # Gather up the values for the list of keys passed in - return [x for x in data if x[filter_attr]] + return [x for x in data if x.has_key(filter_attr) and x[filter_attr]] @staticmethod def oo_parse_heat_stack_outputs(data): -- cgit v1.2.3