1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #8119 from adamchainz/devel

Fix indentation in ec2.py
This commit is contained in:
Chris Church 2014-07-14 18:09:50 -04:00
commit f063aafeeb

View file

@ -240,7 +240,7 @@ class Ec2Inventory(object):
self.cache_path_cache = cache_dir + "/ansible-ec2.cache" self.cache_path_cache = cache_dir + "/ansible-ec2.cache"
self.cache_path_index = cache_dir + "/ansible-ec2.index" self.cache_path_index = cache_dir + "/ansible-ec2.index"
self.cache_max_age = config.getint('ec2', 'cache_max_age') self.cache_max_age = config.getint('ec2', 'cache_max_age')
def parse_cli_args(self): def parse_cli_args(self):
@ -285,12 +285,12 @@ class Ec2Inventory(object):
if conn is None: if conn is None:
print("region name: %s likely not supported, or AWS is down. connection to region failed." % region) print("region name: %s likely not supported, or AWS is down. connection to region failed." % region)
sys.exit(1) sys.exit(1)
reservations = conn.get_all_instances() reservations = conn.get_all_instances()
for reservation in reservations: for reservation in reservations:
for instance in reservation.instances: for instance in reservation.instances:
self.add_instance(instance, region) self.add_instance(instance, region)
except boto.exception.BotoServerError, e: except boto.exception.BotoServerError, e:
if not self.eucalyptus: if not self.eucalyptus:
print "Looks like AWS is down again:" print "Looks like AWS is down again:"
@ -298,7 +298,7 @@ class Ec2Inventory(object):
sys.exit(1) sys.exit(1)
def get_rds_instances_by_region(self, region): def get_rds_instances_by_region(self, region):
''' Makes an AWS API call to the list of RDS instances in a particular ''' Makes an AWS API call to the list of RDS instances in a particular
region ''' region '''
try: try:
@ -368,7 +368,7 @@ class Ec2Inventory(object):
# Inventory: Group by key pair # Inventory: Group by key pair
if instance.key_name: if instance.key_name:
self.push(self.inventory, self.to_safe('key_' + instance.key_name), dest) self.push(self.inventory, self.to_safe('key_' + instance.key_name), dest)
# Inventory: Group by security group # Inventory: Group by security group
try: try:
for group in instance.groups: for group in instance.groups:
@ -426,10 +426,10 @@ class Ec2Inventory(object):
# Inventory: Group by availability zone # Inventory: Group by availability zone
self.push(self.inventory, instance.availability_zone, dest) self.push(self.inventory, instance.availability_zone, dest)
# Inventory: Group by instance type # Inventory: Group by instance type
self.push(self.inventory, self.to_safe('type_' + instance.instance_class), dest) self.push(self.inventory, self.to_safe('type_' + instance.instance_class), dest)
# Inventory: Group by security group # Inventory: Group by security group
try: try:
if instance.security_group: if instance.security_group: