Merge pull request #11293 from tamsky/tamsky-patch-1

for tags with empty value, do not append separator
This commit is contained in:
Brian Coca 2015-06-17 09:55:07 -04:00
commit cce6edeb6c

View file

@ -520,7 +520,10 @@ class Ec2Inventory(object):
# Inventory: Group by tag keys
if self.group_by_tag_keys:
for k, v in instance.tags.items():
key = self.to_safe("tag_" + k + "=" + v)
if v:
key = self.to_safe("tag_" + k + "=" + v)
else:
key = self.to_safe("tag_" + k)
self.push(self.inventory, key, dest)
if self.nested_groups:
self.push_group(self.inventory, 'tags', self.to_safe("tag_" + k))