diff options
author | Victor Salgado <vms@pinhaotec.com.br> | 2015-09-17 13:52:54 -0300 |
---|---|---|
committer | Victor Salgado <vms@pinhaotec.com.br> | 2015-09-17 13:52:54 -0300 |
commit | 14fefebaad0d5a6fc70cb913b138da78345818f9 (patch) | |
tree | 54a4024a1275c0250e9ea7d780eaa7da6ba4b948 | |
parent | 01ae60d5240370359e97a8a79759a3c80eea46a0 (diff) | |
download | ansible-14fefebaad0d5a6fc70cb913b138da78345818f9.tar.gz |
Modify _split_pattern to use map when working with list input
-rw-r--r-- | lib/ansible/inventory/__init__.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 079243b0cd..643f12d8fd 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -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) |