Skip to content

Commit

Permalink
Only pull name tags for extant instances
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrowne committed Jan 17, 2014
1 parent 13706f2 commit 35480a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/elbadmin
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ def get(elb, name):
instance_health = b.get_instance_health()
instances = [state.instance_id for state in instance_health]

names = {}
for i in ec2.get_only_instances(instances):
names[i.id] = i.tags.get('Name', '')
names = dict((k,'') for k in instances)
for i in ec2.get_only_instances():
if i.id in instances:
names[i.id] = i.tags.get('Name', '')

name_column_width = max([4] + [len(v) for k,v in names.iteritems()]) + 2

Expand Down

0 comments on commit 35480a6

Please sign in to comment.