return empty host list when pattern is empty

fixes #37894
This commit is contained in:
Brian Coca 2018-03-26 10:58:57 -04:00 committed by Brian Coca
parent fda9312379
commit 2e852fcd6d

View file

@ -330,12 +330,15 @@ class InventoryManager(object):
or applied subsets
"""
hosts = []
# Check if pattern already computed
if isinstance(pattern, list):
pattern_hash = u":".join(pattern)
else:
pattern_hash = pattern
if pattern_hash:
if not ignore_limits and self._subset:
pattern_hash += u":%s" % to_text(self._subset, errors='surrogate_or_strict')