Bläddra i källkod

Merge pull request #868 from ibotty/oo-filter-dont-fail

oo_filter: don't fail when attribute is not defined
Thomas Wiest 9 år sedan
förälder
incheckning
4c6ef62365
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      filter_plugins/oo_filters.py

+ 1 - 1
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):