fixed whitespace and added a comment to explain if statement
This commit is contained in:
parent
4733dc6b5b
commit
f4db6d1a91
1 changed files with 7 additions and 5 deletions
|
@ -245,8 +245,9 @@ class Ec2Inventory(object):
|
|||
else:
|
||||
conn = ec2.connect_to_region(region)
|
||||
|
||||
# connect_to_region will fail "silently" by returning None if the region name is wrong or not supported
|
||||
if conn is None:
|
||||
print("AWS is down or region name: %s likely not supported. connection to region failed." % region)
|
||||
print("region name: %s likely not supported, or AWS is down. connection to region failed." % region)
|
||||
sys.exit(1)
|
||||
|
||||
reservations = conn.get_all_instances()
|
||||
|
@ -283,8 +284,9 @@ class Ec2Inventory(object):
|
|||
else:
|
||||
conn = ec2.connect_to_region(region)
|
||||
|
||||
# connect_to_region will fail "silently" by returning None if the region name is wrong or not supported
|
||||
if conn is None:
|
||||
print("AWS is down or region name: %s likely not supported. connection to region failed." % region)
|
||||
print("region name: %s likely not supported, or AWS is down. connection to region failed." % region)
|
||||
sys.exit(1)
|
||||
|
||||
reservations = conn.get_all_instances([instance_id])
|
||||
|
|
Loading…
Reference in a new issue