From 139a072afa927420ec76ac2b7756190dbbb43b50 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Thu, 6 Aug 2015 15:03:54 -0400 Subject: [PATCH] Don't create a group that is its own parent when an EC2 tag has an empty value. Fixes https://trello.com/c/2zc0odvX --- awx/plugins/inventory/ec2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/plugins/inventory/ec2.py b/awx/plugins/inventory/ec2.py index 112f5c29e8..53c699227d 100755 --- a/awx/plugins/inventory/ec2.py +++ b/awx/plugins/inventory/ec2.py @@ -527,7 +527,8 @@ class Ec2Inventory(object): self.push(self.inventory, key, dest) if self.nested_groups: self.push_group(self.inventory, 'tags', self.to_safe("tag_" + k)) - self.push_group(self.inventory, self.to_safe("tag_" + k), key) + if v: + self.push_group(self.inventory, self.to_safe("tag_" + k), key) # Inventory: Group by Route53 domain names if enabled if self.route53_enabled and self.group_by_route53_names: