Commit ff44c981 by Michael DeHaan

Merge pull request #3770 from rishid/devel

Add support for INI comments that begin with '#' or ';'
parents 99775176 d18c90ed
......@@ -75,7 +75,7 @@ class InventoryParser(object):
elif active_group_name not in self.groups:
new_group = self.groups[active_group_name] = Group(name=active_group_name)
all.add_child_group(new_group)
elif line.startswith("#") or line == '':
elif line.startswith("#") or line.startswith(";") or line == '':
pass
elif active_group_name:
tokens = shlex.split(line.split(" #")[0])
......@@ -132,7 +132,7 @@ class InventoryParser(object):
group = self.groups.get(line, None)
if group is None:
group = self.groups[line] = Group(name=line)
elif line.startswith("#"):
elif line.startswith("#") or line.startswith(";"):
pass
elif line.startswith("["):
group = None
......@@ -157,7 +157,7 @@ class InventoryParser(object):
group = self.groups.get(line, None)
if group is None:
raise errors.AnsibleError("can't add vars to undefined group: %s" % line)
elif line.startswith("#"):
elif line.startswith("#") or line.startswith(";"):
pass
elif line.startswith("["):
group = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment