Modify _split_pattern to use map when working with list input

pull/12415/head^2
Victor Salgado 9 years ago
parent 01ae60d524
commit 14fefebaad

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

Loading…
Cancel
Save