Fix edge case in inventory import that would cause a group to become its own parent.

This commit is contained in:
Chris Church
2014-03-31 17:37:35 -04:00
parent 2913ce21d2
commit d7f31f9777
2 changed files with 18 additions and 2 deletions

View File

@@ -649,7 +649,7 @@ class Command(NoArgsCommand):
self.logger.info('Group "%s" variables updated', k)
else:
self.logger.info('Group "%s" variables unmodified', k)
if self.inventory_source.group:
if self.inventory_source.group and self.inventory_source.group != group:
self.inventory_source.group.children.add(group)
group.inventory_sources.add(self.inventory_source)