Merge pull request #2073 from nigelm/hosts_comment_fix
Allow end of line comments in inventory file - fixes #2072
This commit is contained in:
commit
9cb710b2f7
1 changed files with 2 additions and 0 deletions
|
@ -109,6 +109,8 @@ class InventoryParser(object):
|
||||||
self.hosts[hn] = host
|
self.hosts[hn] = host
|
||||||
if len(tokens) > 1:
|
if len(tokens) > 1:
|
||||||
for t in tokens[1:]:
|
for t in tokens[1:]:
|
||||||
|
if t.startswith('#'):
|
||||||
|
break
|
||||||
(k,v) = t.split("=")
|
(k,v) = t.split("=")
|
||||||
host.set_variable(k,v)
|
host.set_variable(k,v)
|
||||||
self.groups[active_group_name].add_host(host)
|
self.groups[active_group_name].add_host(host)
|
||||||
|
|
Loading…
Reference in a new issue