[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:29:56 UTC 2013


The following commit has been merged in the master branch:
commit 529efbdbcdd41f11bd98d20f38003b524039afd8
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Sat Sep 29 21:51:32 2012 -0700

    Add /etc/euca2ools.ini and ~/.euca/*.ini as config files

diff --git a/euca2ools/commands/__init__.py b/euca2ools/commands/__init__.py
index 87aabc4..d2c60c7 100644
--- a/euca2ools/commands/__init__.py
+++ b/euca2ools/commands/__init__.py
@@ -28,6 +28,8 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
+import glob
+import os.path
 import platform
 import requestbuilder.command
 import requestbuilder.request
@@ -36,8 +38,16 @@ from .. import __version__, __codename__
 class Euca2oolsCommand(requestbuilder.command.BaseCommand):
     Version = 'euca2ools {0} ({1})'.format(__version__, __codename__)
 
+    def __init__(self, **kwargs):
+        self.ConfigFiles.append('/etc/euca2ools.ini')
+        user_config_glob = os.path.join(os.path.expanduser('~/.euca'), '*.ini')
+        for configfile in sorted(glob.glob(user_config_glob)):
+            self.ConfigFiles.append(configfile)
+        requestbuilder.request.BaseCommand.__init__(self, **kwargs)
+
 class Euca2oolsRequest(Euca2oolsCommand, requestbuilder.request.BaseRequest):
     def __init__(self, **kwargs):
+        Euca2oolsCommand.__init__(self, **kwargs)
         requestbuilder.request.BaseRequest.__init__(self, **kwargs)
         self.__user_agent = None
 

-- 
managing cloud instances for Eucalyptus



More information about the pkg-eucalyptus-commits mailing list