cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlsoren...@apache.org
Subject [26/50] git commit: cli: Fix common.py's cfg fields grouped under similarites like ui, core, user etc.
Date Wed, 30 Jan 2013 20:55:08 GMT
cli: Fix common.py's cfg fields grouped under similarites like ui, core, user etc.

Changes config path to ~/.cloudmonkey this will break cfg path but all configs are
still backward compatible. We need folder to put a lot of stuff that is coming
for ex. themes and plugins

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


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

Branch: refs/heads/add_remove_nics
Commit: 233c0adcf353f8ff2f4a04fa1965c14e2964bba7
Parents: 0720d25
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Mon Jan 28 17:51:53 2013 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Mon Jan 28 17:52:40 2013 -0800

----------------------------------------------------------------------
 tools/cli/cloudmonkey/common.py |   46 +++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/233c0adc/tools/cli/cloudmonkey/common.py
----------------------------------------------------------------------
diff --git a/tools/cli/cloudmonkey/common.py b/tools/cli/cloudmonkey/common.py
index 5adb6d4..05767a5 100644
--- a/tools/cli/cloudmonkey/common.py
+++ b/tools/cli/cloudmonkey/common.py
@@ -17,25 +17,43 @@
 # under the License.
 
 # Use following rules for versioning:
-# <cloudstack major version>.<cloudstack minor version>.<cli increment>
-__version__ = "4.0.0"
+# <cloudstack version>-<cli increment, starts from 0>
+__version__ = "4.1.0-0"
 
 try:
+    from os.path import expanduser
     import os
     from precache import precached_verbs
 except ImportError, e:
     precached_verbs = {}
 
-# Add config key:value
-config_file = os.path.expanduser('~/.cloudmonkey_config')
-config_fields = {'host': 'localhost', 'port': '8080',
-                 'protocol': 'http', 'path': '/client/api',
-                 'apikey': '', 'secretkey': '',
-                 'timeout': '3600', 'asyncblock': 'true',
-                 'prompt': '🐵 cloudmonkey>', 'color': 'true',
-                 'tabularize': 'false',
-                 'log_file':
-                 os.path.expanduser('~/.cloudmonkey_log'),
-                 'history_file':
-                 os.path.expanduser('~/.cloudmonkey_history')}
+param_type = ['boolean', 'date', 'float', 'integer', 'short', 'list',
+              'long', 'object', 'map', 'string', 'tzdate', 'uuid']
 
+config_dir = expanduser('~/.cloudmonkey')
+config_file = expanduser(config_dir + '/config')
+
+# cloudmonkey config fields
+config_fields = {'core': {}, 'ui': {}, 'server': {}, 'user': {}}
+
+# core
+config_fields['core']['cache_file'] = expanduser(config_dir + '/cache')
+config_fields['core']['history_file'] = expanduser(config_dir + '/history')
+config_fields['core']['log_file'] = expanduser(config_dir + '/log')
+
+# ui
+config_fields['ui']['color'] = 'true'
+config_fields['ui']['prompt'] = '> '
+config_fields['ui']['tabularize'] = 'false'
+
+# server
+config_fields['server']['asyncblock'] = 'true'
+config_fields['server']['host'] = 'localhost'
+config_fields['server']['path'] = '/client/api'
+config_fields['server']['port'] = '8080'
+config_fields['server']['protocol'] = 'http'
+config_fields['server']['timeout'] = '3600'
+
+# user
+config_fields['user']['apikey'] = ''
+config_fields['user']['secretkey'] = ''


Mime
View raw message