diff --git a/lib/ansible/plugins/filter/core.py b/lib/ansible/plugins/filter/core.py index 8180f10e846..41d50f6fc9c 100644 --- a/lib/ansible/plugins/filter/core.py +++ b/lib/ansible/plugins/filter/core.py @@ -41,7 +41,7 @@ import uuid import yaml from jinja2.filters import environmentfilter from distutils.version import LooseVersion, StrictVersion -from ansible.compat.six import iteritems +from ansible.compat.six import iteritems, string_types from ansible import errors from ansible.parsing.yaml.dumper import AnsibleDumper @@ -110,7 +110,7 @@ def bool(a): ''' return a bool for the arg ''' if a is None or type(a) == bool: return a - if type(a) in types.StringTypes: + if isinstance(a, string_types): a = a.lower() if a in ['yes', 'on', '1', 'true', 1]: return True