Make sure pattern cache components are converted to unicode

pull/13112/head
James Cammarata 9 years ago
parent 0b999c602a
commit e56fd9e95d

@ -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][:]

Loading…
Cancel
Save