Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: third_party/boto/bin/elbadmin

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/boto/bin/cq ('k') | third_party/boto/bin/glacier » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/boto/bin/elbadmin
===================================================================
--- third_party/boto/bin/elbadmin (revision 33376)
+++ third_party/boto/bin/elbadmin (working copy)
@@ -72,6 +72,10 @@
for b in elb.get_all_load_balancers():
print "%-20s %s" % (b.name, b.dns_name)
+def check_valid_region(conn, region):
+ if conn is None:
+ print 'Invalid region (%s)' % region
+ sys.exit(1)
def get(elb, name):
"""Get details about ELB <name>"""
@@ -108,18 +112,20 @@
print
# Make map of all instance Id's to Name tags
+ import boto
if not options.region:
ec2 = boto.connect_ec2()
else:
- import boto.ec2.elb
ec2 = boto.ec2.connect_to_region(options.region)
+ check_valid_region(ec2, options.region)
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
@@ -254,6 +260,7 @@
else:
import boto.ec2.elb
elb = boto.ec2.elb.connect_to_region(options.region)
+ check_valid_region(elb, options.region)
print "%s" % (elb.region.endpoint)
« no previous file with comments | « third_party/boto/bin/cq ('k') | third_party/boto/bin/glacier » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698