|
|
|
@ -340,18 +340,18 @@ class Ec2Inventory(object):
|
|
|
|
|
|
|
|
|
|
# Regions
|
|
|
|
|
self.regions = []
|
|
|
|
|
configRegions = config.get('ec2', 'regions')
|
|
|
|
|
if (configRegions == 'all'):
|
|
|
|
|
config_regions = config.get('ec2', 'regions')
|
|
|
|
|
if (config_regions == 'all'):
|
|
|
|
|
if self.eucalyptus_host:
|
|
|
|
|
self.regions.append(boto.connect_euca(host=self.eucalyptus_host).region.name, **self.credentials)
|
|
|
|
|
else:
|
|
|
|
|
configRegions_exclude = config.get('ec2', 'regions_exclude')
|
|
|
|
|
config_regions_exclude = config.get('ec2', 'regions_exclude')
|
|
|
|
|
|
|
|
|
|
for regionInfo in ec2.regions():
|
|
|
|
|
if regionInfo.name not in configRegions_exclude:
|
|
|
|
|
self.regions.append(regionInfo.name)
|
|
|
|
|
for region_info in ec2.regions():
|
|
|
|
|
if region_info.name not in config_regions_exclude:
|
|
|
|
|
self.regions.append(region_info.name)
|
|
|
|
|
else:
|
|
|
|
|
self.regions = configRegions.split(",")
|
|
|
|
|
self.regions = config_regions.split(",")
|
|
|
|
|
if 'auto' in self.regions:
|
|
|
|
|
env_region = os.environ.get('AWS_REGION')
|
|
|
|
|
if env_region is None:
|
|
|
|
|