Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ACB99C02C for ; Sun, 16 Jun 2013 13:43:13 +0000 (UTC) Received: (qmail 20837 invoked by uid 500); 16 Jun 2013 13:43:13 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 20761 invoked by uid 500); 16 Jun 2013 13:43:13 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 20749 invoked by uid 99); 16 Jun 2013 13:43:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Jun 2013 13:43:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A5F018A53E0; Sun, 16 Jun 2013 13:43:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhaisaab@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.1 to 3bd8f7e Date: Sun, 16 Jun 2013 13:43:12 +0000 (UTC) Updated Branches: refs/heads/4.1 0706a8947 -> 3bd8f7e6d cloudmonkey: Fix asyncblock infinite recursion Signed-off-by: Rohit Yadav Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3bd8f7e6 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3bd8f7e6 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3bd8f7e6 Branch: refs/heads/4.1 Commit: 3bd8f7e6d5d2d08113b812363038b2616016b9cf Parents: 0706a89 Author: Rohit Yadav Authored: Sun Jun 16 19:07:08 2013 +0530 Committer: Rohit Yadav Committed: Sun Jun 16 19:09:34 2013 +0530 ---------------------------------------------------------------------- tools/cli/cloudmonkey/requester.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3bd8f7e6/tools/cli/cloudmonkey/requester.py ---------------------------------------------------------------------- diff --git a/tools/cli/cloudmonkey/requester.py b/tools/cli/cloudmonkey/requester.py index 5c4cd1e..a85b6d0 100644 --- a/tools/cli/cloudmonkey/requester.py +++ b/tools/cli/cloudmonkey/requester.py @@ -60,11 +60,11 @@ def make_request(command, args, logger, host, port, args["apiKey"] = apikey args["response"] = "json" request = zip(args.keys(), args.values()) - request.sort(key=lambda x: str.lower(x[0])) + request.sort(key=lambda x: x[0].lower()) request_url = "&".join(["=".join([r[0], urllib.quote_plus(str(r[1]))]) for r in request]) - hashStr = "&".join(["=".join([str.lower(r[0]), + hashStr = "&".join(["=".join([r[0].lower(), str.lower(urllib.quote_plus(str(r[1]))).replace("+", "%20")]) for r in request]) @@ -130,14 +130,18 @@ def monkeyrequest(command, args, isasync, asyncblock, logger, host, port, progress += 1 logger_debug(logger, "Job %s to timeout in %ds" % (jobid, timeout)) sys.stdout.flush() - response, error = monkeyrequest(command, request, isasync, - asyncblock, logger, - host, port, apikey, secretkey, - timeout, protocol, path) + response, error = make_request(command, request, logger, + host, port, apikey, secretkey, + protocol, path) + if error is not None: + return response, error + response = process_json(response) responsekeys = filter(lambda x: 'response' in x, response.keys()) + if len(responsekeys) < 1: continue + result = response[responsekeys[0]] jobstatus = result['jobstatus'] if jobstatus == 2: