Modify _split_pattern to use map when working with list input
This commit is contained in:
parent
01ae60d524
commit
14fefebaad
1 changed files with 2 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue