From e56fd9e95d26f8040cfc83980165307347ad0399 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 10 Nov 2015 08:28:45 -0500 Subject: [PATCH] Make sure pattern cache components are converted to unicode --- lib/ansible/inventory/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 69f520cdd3e..4d866587daf 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -34,6 +34,7 @@ from ansible.inventory.dir import InventoryDirectory, get_file_parser from ansible.inventory.group import Group from ansible.inventory.host import Host from ansible.plugins import vars_loader +from ansible.utils.unicode import to_unicode from ansible.utils.vars import combine_vars from ansible.parsing.utils.addresses import parse_address @@ -173,9 +174,9 @@ class Inventory(object): if not ignore_limits_and_restrictions: if self._subset: - pattern_hash += u":%s" % self._subset + pattern_hash += u":%s" % to_unicode(self._subset) if self._restriction: - pattern_hash += u":%s" % self._restriction + pattern_hash += u":%s" % to_unicode(self._restriction) if pattern_hash in HOSTS_PATTERNS_CACHE: return HOSTS_PATTERNS_CACHE[pattern_hash][:]