diff options
author | rishid <rishid@gmail.com> | 2013-08-06 11:41:07 -0400 |
---|---|---|
committer | rishid <rishid@gmail.com> | 2013-08-06 11:41:07 -0400 |
commit | d18c90ed8fb4927c752ec69caca854d7a7190fe4 (patch) | |
tree | 833e1f24b10e061476eb1acfd40e290904a5e245 | |
parent | 5f18a535303decd84b63fb343803b64ddedf4e47 (diff) | |
download | ansible-d18c90ed8fb4927c752ec69caca854d7a7190fe4.tar.gz |
Add support for INI comments that begin with '#' or ';'
Ini file format does not have a standard but ';' is used more often than '#' for comments
-rw-r--r-- | lib/ansible/inventory/ini.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index 1c7ae58bf1..8cc0c87831 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -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 |