From 13bf62d0e6805ecc03aee588a6e3fad407e808ec Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Sat, 31 Oct 2015 16:25:57 -0400 Subject: [PATCH] remove deprecation for :, add ; functionality (its deprecated but it should work) --- lib/ansible/inventory/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index d69b6bcb925..a967553385d 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -189,7 +189,8 @@ class Inventory(object): return list(itertools.chain(*map(cls.split_host_pattern, pattern))) if ';' in pattern: - display.deprecated("Use ',' instead of ';' to separate host patterns") + patterns = re.split('\s*;\s*', pattern) + display.deprecated("Use ',' or ':' instead of ';' to separate host patterns") # If it's got commas in it, we'll treat it as a straightforward # comma-separated list of patterns. @@ -199,7 +200,6 @@ class Inventory(object): # If it doesn't, it could still be a single pattern. This accounts for # non-separator uses of colons: IPv6 addresses and [x:y] host ranges. - else: (base, port) = parse_address(pattern, allow_ranges=True) if base: @@ -219,9 +219,6 @@ class Inventory(object): ''', pattern, re.X ) - if len(patterns) > 1: - display.deprecated("Use ',' instead of ':' to separate host patterns") - return [p.strip() for p in patterns] @classmethod