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/08/22 10:22:29 UTC
[1/2] git commit: cloudmonkey: be backward compatible for options -
host, port, path, protocol
Repository: cloudstack-cloudmonkey
Updated Branches:
refs/heads/master 264ddcecb -> 29695f974
cloudmonkey: be backward compatible for options - host, port, path, protocol
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/11d95b43
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/11d95b43
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/11d95b43
Branch: refs/heads/master
Commit: 11d95b43a1efda9608e4ff6009ff1e4bfe702d18
Parents: 264ddce
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Thu Aug 21 16:08:00 2014 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Thu Aug 21 16:08:00 2014 +0200
----------------------------------------------------------------------
cloudmonkey/cloudmonkey.py | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/11d95b43/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py
index c85bc15..5130f12 100644
--- a/cloudmonkey/cloudmonkey.py
+++ b/cloudmonkey/cloudmonkey.py
@@ -37,6 +37,7 @@ try:
from requester import monkeyrequest
from requester import login
from requester import logout
+ from urlparse import urlparse
except ImportError, e:
print("Import error in %s : %s" % (__name__, e))
import sys
@@ -69,6 +70,10 @@ class CloudMonkeyShell(cmd.Cmd, object):
config_options = []
verbs = []
prompt = "🐵 > "
+ protocol = "http"
+ host = "localhost"
+ port = "8080"
+ path = "/client/api"
def __init__(self, pname, cfile):
self.program_name = pname
@@ -95,6 +100,11 @@ class CloudMonkeyShell(cmd.Cmd, object):
self.credentials = {'apikey': self.apikey, 'secretkey': self.secretkey,
'username': self.username,
'password': self.password}
+ parsed_url = urlparse(self.url)
+ self.protocol = "http" if not parsed_url.scheme else parsed_url.scheme
+ self.host = parsed_url.netloc
+ self.port = "8080" if not parsed_url.port else parsed_url.port
+ self.path = parsed_url.path
def get_attr(self, field):
return getattr(self, field)
@@ -411,10 +421,12 @@ class CloudMonkeyShell(cmd.Cmd, object):
"""
args = args.strip().partition(" ")
key, value = (args[0], args[2])
- if key in ['host', 'port', 'path', 'protocol']:
- print "This parameter has been deprecated, please set 'url' instead"
- return
setattr(self, key, value)
+ if key in ['host', 'port', 'path', 'protocol']:
+ key = 'url'
+ self.url = "%s://%s:%s%s" % (self.protocol, self.host, self.port, self.path)
+ print "This option has been deprecated, please set 'url' instead"
+ print "This server url will be used:", self.url
write_config(self.get_attr, self.config_file)
if key.strip() == 'profile':
read_config(self.get_attr, self.set_attr, self.config_file)
[2/2] git commit: CHANGES: update change file for release 5.2.0
Posted by bh...@apache.org.
CHANGES: update change file for release 5.2.0
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/29695f97
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/29695f97
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/29695f97
Branch: refs/heads/master
Commit: 29695f97494b1046b77d483af2a5f064c168823c
Parents: 11d95b4
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Thu Aug 21 16:15:45 2014 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Thu Aug 21 16:15:45 2014 +0200
----------------------------------------------------------------------
CHANGES | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/29695f97/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index dc8eb0f..4c71876 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,7 +8,8 @@ This release includes
- For missing keys, cloudmonkey will set default values
- Network requests, json decoding and shell related bugfixes
- Based on platform, it will install either pyreadline (Windows) or readline (OSX and Linux)
- - Config param removal of `protocol`, `host`, `port`, `path`; uses `url` for the mgmt server URL
+ - Config options `protocol`, `host`, `port`, `path` are deprecated now
+ - Backward compatibilty exists for above options but we use `url` for the mgmt server URL
- Introduces server profiles so users can use cloudmonkey with different hosts and management server configs
- A default profile under the section [local] is added with default values
- Everytime `set` is called, cloudmonkey will write the config and reload config file