You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2014/10/29 14:26:10 UTC

git commit: config: if profile is missing, use the default server profile name

Repository: cloudstack-cloudmonkey
Updated Branches:
  refs/heads/master 03a1ecf25 -> a084f9dd5


config: if profile is missing, use the default server profile name

This can happen in case a user is upgrading from older cloudmonkey release

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/master
Commit: a084f9dd545713702a527cab36995d078c5d0b02
Parents: 03a1ecf
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Wed Oct 29 18:55:23 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Wed Oct 29 18:55:23 2014 +0530

----------------------------------------------------------------------
 cloudmonkey/config.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/a084f9dd/cloudmonkey/config.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/config.py b/cloudmonkey/config.py
index 3336274..b1aba44 100644
--- a/cloudmonkey/config.py
+++ b/cloudmonkey/config.py
@@ -153,7 +153,11 @@ def read_config(get_attr, set_attr, config_file):
         print "After setting up, run the `sync` command to sync apis\n"
 
     missing_keys = []
-    profile = config.get('core', 'profile')
+    if config.has_option('core', 'profile'):
+        profile = config.get('core', 'profile')
+    else:
+        global default_profile_name
+        profile = default_profile_name
     if profile is None or profile == '' or profile in mandatory_sections:
         print "Server profile cannot be", profile
         sys.exit(1)