Merge pull request #11631 from bearstech/gce

GCE tag prefix for creating ansible group.
This commit is contained in:
Brian Coca 2015-07-20 19:58:29 -04:00
commit 5b5ba35111

View file

@ -257,7 +257,10 @@ class GceInventory(object):
tags = node.extra['tags'] tags = node.extra['tags']
for t in tags: for t in tags:
tag = 'tag_%s' % t if t.startswith('group-'):
tag = t[6:]
else:
tag = 'tag_%s' % t
if groups.has_key(tag): groups[tag].append(name) if groups.has_key(tag): groups[tag].append(name)
else: groups[tag] = [name] else: groups[tag] = [name]