Allow pattern[0] to address a single node

Replaces erroring out on it and requiring the abysmal pattern[0-0]
instead.
pull/1835/merge
Daniel Hokka Zakrisson 12 years ago
parent 03ab074d0d
commit c23eda82c2

@ -165,10 +165,11 @@ class Inventory(object):
return (pattern, None)
(first, rest) = pattern.split("[")
rest = rest.replace("]","")
if not "-" in rest:
raise errors.AnsibleError("invalid pattern: %s" % pattern)
(left, right) = rest.split("-",1)
return (first, (left, right))
if "-" in rest:
(left, right) = rest.split("-",1)
return (first, (left, right))
else:
return (first, (rest, rest))
def _apply_ranges(self, pat, hosts):
"""

Loading…
Cancel
Save