|
|
@ -226,6 +226,7 @@ class Ec2Inventory(object):
|
|
|
|
|
|
|
|
|
|
|
|
defaults = {
|
|
|
|
defaults = {
|
|
|
|
'ec2': {
|
|
|
|
'ec2': {
|
|
|
|
|
|
|
|
'ini_fallback': os.path.join(os.path.dirname(__file__), 'ec2.ini'),
|
|
|
|
'ini_path': os.path.join(os.path.dirname(__file__), '%s.ini' % scriptbasename)
|
|
|
|
'ini_path': os.path.join(os.path.dirname(__file__), '%s.ini' % scriptbasename)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -236,6 +237,10 @@ class Ec2Inventory(object):
|
|
|
|
config = configparser.SafeConfigParser()
|
|
|
|
config = configparser.SafeConfigParser()
|
|
|
|
ec2_ini_path = os.environ.get('EC2_INI_PATH', defaults['ec2']['ini_path'])
|
|
|
|
ec2_ini_path = os.environ.get('EC2_INI_PATH', defaults['ec2']['ini_path'])
|
|
|
|
ec2_ini_path = os.path.expanduser(os.path.expandvars(ec2_ini_path))
|
|
|
|
ec2_ini_path = os.path.expanduser(os.path.expandvars(ec2_ini_path))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not os.path.isfile(ec2_ini_path):
|
|
|
|
|
|
|
|
ec2_ini_path = os.path.expanduser(defaults['ec2']['ini_fallback'])
|
|
|
|
|
|
|
|
|
|
|
|
config.read(ec2_ini_path)
|
|
|
|
config.read(ec2_ini_path)
|
|
|
|
|
|
|
|
|
|
|
|
# is eucalyptus?
|
|
|
|
# is eucalyptus?
|
|
|
|