Updated Branches: refs/heads/master 2ee9253c7 -> 311ef69a7
CLOUDSTACK-514: Added protocol and path support to cloudmonkey. This is the second half of making cloudmonkey and marvin more flexible in environments that may have https enabled and / or a different path for the cloudstack API. Signed-off-by: Chip Childers <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/311ef69a Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/311ef69a Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/311ef69a Branch: refs/heads/master Commit: 311ef69a77e0f9b02b714786f04214ab9e0d0169 Parents: 4e00631 Author: Chip Childers <[email protected]> Authored: Mon Nov 19 14:24:10 2012 -0500 Committer: Chip Childers <[email protected]> Committed: Mon Nov 19 14:24:10 2012 -0500 ---------------------------------------------------------------------- tools/cli/cloudmonkey/cloudmonkey.py | 10 +++++++--- tools/cli/cloudmonkey/common.py | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/311ef69a/tools/cli/cloudmonkey/cloudmonkey.py ---------------------------------------------------------------------- diff --git a/tools/cli/cloudmonkey/cloudmonkey.py b/tools/cli/cloudmonkey/cloudmonkey.py index 9ba7e8d..4630136 100644 --- a/tools/cli/cloudmonkey/cloudmonkey.py +++ b/tools/cli/cloudmonkey/cloudmonkey.py @@ -81,8 +81,9 @@ class CloudStackShell(cmd.Cmd): for key in self.config_fields.keys(): setattr(self, key, self.config_fields[key]) config = self.write_config() - print("Set your apikey, secretkey, host, port, prompt, color," - " log_file, history_file using the set command!") + print("Set your apikey, secretkey, host, port, prompt," + " protocol, path, color, log_file and history_file" + " using the set command!") for key in self.config_fields.keys(): try: @@ -195,10 +196,13 @@ class CloudStackShell(cmd.Cmd): def make_request(self, command, requests={}, isAsync=False): conn = cloudConnection(self.host, port=int(self.port), apiKey=self.apikey, securityKey=self.secretkey, - asyncTimeout=self.timeout, logging=logger) + asyncTimeout=self.timeout, logging=logger, + protocol=self.protocol, path=self.path) response = None try: + self.print_shell("Starting call") response = conn.make_request_with_auth(command, requests) + self.print_shell("Ending call") except cloudstackAPIException, e: self.print_shell("API Error:", e) except HTTPError, e: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/311ef69a/tools/cli/cloudmonkey/common.py ---------------------------------------------------------------------- diff --git a/tools/cli/cloudmonkey/common.py b/tools/cli/cloudmonkey/common.py index d525086..a6f3a77 100644 --- a/tools/cli/cloudmonkey/common.py +++ b/tools/cli/cloudmonkey/common.py @@ -30,6 +30,7 @@ except ImportError, e: # 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',
