cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.1 to 3bd8f7e
Date Sun, 16 Jun 2013 13:43:12 GMT
Updated Branches:
  refs/heads/4.1 0706a8947 -> 3bd8f7e6d


cloudmonkey: Fix asyncblock infinite recursion

Signed-off-by: Rohit Yadav <rohit.yadav@wingify.com>


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 <rohit.yadav@wingify.com>
Authored: Sun Jun 16 19:07:08 2013 +0530
Committer: Rohit Yadav <rohit.yadav@wingify.com>
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:


Mime
View raw message