Make sure pattern cache components are converted to unicode

This commit is contained in:
James Cammarata 2015-11-10 08:28:45 -05:00
parent 0b999c602a
commit e56fd9e95d

View file

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