Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for INI comments that begin with '#' or ';' #3770

Merged
merged 1 commit into from
Aug 6, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/ansible/inventory/ini.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _parse_base_groups(self):
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])
Expand Down Expand Up @@ -132,7 +132,7 @@ def _parse_group_children(self):
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
Expand All @@ -157,7 +157,7 @@ def _parse_group_variables(self):
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
Expand Down