cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seb...@apache.org
Subject [32/50] [abbrv] cloudstack-gcestack git commit: Add check to ensure profile requested is in config
Date Tue, 05 May 2015 11:19:06 GMT
Add check to ensure profile requested is in config


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/commit/df678ea5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/tree/df678ea5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/diff/df678ea5

Branch: refs/heads/master
Commit: df678ea52a156dd994dcc57b464ec97b10c6964b
Parents: d4126d5
Author: BroganD1993 <darrenbrogan@hotmail.com>
Authored: Tue Jun 24 18:51:41 2014 +0100
Committer: BroganD1993 <darrenbrogan@hotmail.com>
Committed: Tue Jun 24 18:51:41 2014 +0100

----------------------------------------------------------------------
 gstack/__init__.py | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/blob/df678ea5/gstack/__init__.py
----------------------------------------------------------------------
diff --git a/gstack/__init__.py b/gstack/__init__.py
index 924a955..782d694 100644
--- a/gstack/__init__.py
+++ b/gstack/__init__.py
@@ -78,6 +78,11 @@ def _config_from_config_profile(config_file, profile):
     config = SafeConfigParser()
     config.read(config_file)
 
+    if not config.has_section(profile):
+        sys.exit('No profile matching '+ profile
+                 + ' found in configuration, please run gstack-configure -p '
+                 + profile)
+
     for attribute in config.options(profile):
         app.config[attribute.upper()] = config.get(profile, attribute)
 


Mime
View raw message