Modify _split_pattern to use map when working with list input

This commit is contained in:
Victor Salgado 2015-09-17 13:52:54 -03:00
parent 01ae60d524
commit 14fefebaad

View file

@ -24,6 +24,7 @@ import os
import sys
import re
import stat
import itertools
from ansible import constants as C
from ansible.errors import AnsibleError
@ -185,9 +186,7 @@ class Inventory(object):
"""
if isinstance(pattern, list):
pattern = ','.join(pattern)
patterns = []
return list(itertools.chain(*map(self._split_pattern, pattern)))
if ';' in pattern:
display.deprecated("Use ',' instead of ':' or ';' to separate host patterns", version=2.0, removed=True)