[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a
Garrett Holmstrom
gholms at fedoraproject.org
Sun Jun 16 02:30:57 UTC 2013
The following commit has been merged in the master branch:
commit 95665e66c9e8e94e61f8f426c76c1b94a9bc3590
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Mon Apr 1 17:04:42 2013 -0700
Also look for configuration in /etc/euca2ools/conf.d/*.ini
diff --git a/euca2ools/commands/__init__.py b/euca2ools/commands/__init__.py
index c850650..5772272 100644
--- a/euca2ools/commands/__init__.py
+++ b/euca2ools/commands/__init__.py
@@ -42,6 +42,10 @@ class Euca2ools(object):
A class with attributes and methods that define the entire euca2ools suite
'''
+ CONFIG_PATHS = ('/etc/euca2ools/euca2ools.ini',
+ '/etc/euca2ools/conf.d/*.ini',
+ '~/.euca/*.ini')
+
def __init__(self):
self.__user_agent = None
@@ -58,12 +62,16 @@ class Euca2ools(object):
pass
sys.exit()
- @staticmethod
- def list_config_files():
- sys_config_files = ['/etc/euca2ools.ini']
- user_glob = os.path.join(os.path.expanduser('~/.euca'), '*.ini')
- user_config_files = sorted(glob.glob(user_glob))
- return sys_config_files + user_config_files
+ def list_config_files(self):
+ config_files = []
+ if 'EUCA_CONFIG_PATH' in os.environ:
+ config_globs = os.getenv('EUCA_CONFIG_PATH').split(':')
+ else:
+ config_globs = self.CONFIG_PATHS
+ for config_glob in config_globs:
+ expanded = os.path.expanduser(os.path.expandvars(config_glob))
+ config_files.extend(sorted(glob.glob(expanded)))
+ return config_files
def get_user_agent(self):
if self.__user_agent is None:
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list