Create groups in the first run through the file

Fixes #1208.
parent 4679d8d6
......@@ -66,6 +66,8 @@ class InventoryParser(object):
if line.startswith("["):
active_group_name = line.replace("[","").replace("]","").strip()
if line.find(":vars") != -1 or line.find(":children") != -1:
active_group_name = active_group_name.rsplit(":", 1)[0]
self.groups[active_group_name] = Group(name=active_group_name)
active_group_name = None
else:
new_group = self.groups[active_group_name] = Group(name=active_group_name)
......
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