You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/09/24 19:29:54 UTC

[18/20] git commit: small fix to make this work with spaces in names

small fix to make this work with spaces in names


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

Branch: refs/heads/4.0
Commit: 503ccb0492ec632a5e261034ebae9b36f6be9a2d
Parents: d10a7cd
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Sat Sep 22 13:43:57 2012 +0200
Committer: Edison Su <su...@gmail.com>
Committed: Mon Sep 24 10:06:12 2012 -0700

----------------------------------------------------------------------
 cloud-cli/cloudapis/cloud.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/503ccb04/cloud-cli/cloudapis/cloud.py
----------------------------------------------------------------------
diff --git a/cloud-cli/cloudapis/cloud.py b/cloud-cli/cloudapis/cloud.py
index 1ee9806..a0e8880 100644
--- a/cloud-cli/cloudapis/cloud.py
+++ b/cloud-cli/cloudapis/cloud.py
@@ -71,10 +71,10 @@ class CloudAPI:
         requests = zip(requests.keys(), requests.values())
         requests.sort(key=lambda x: str.lower(x[0]))
 
-        requestUrl = "&".join(["=".join([request[0], urllib.quote_plus(str(request[1]))]) for request in requests])
-        hashStr = "&".join(["=".join([str.lower(request[0]), urllib.quote_plus(str.lower(str(request[1])))]) for request in requests])
+        requestUrl = "&".join(["=".join([request[0], urllib.quote(str(request[1],""))]) for request in requests])
+        hashStr = "&".join(["=".join([str.lower(request[0]), urllib.quote(str.lower(str(request[1])),"")]) for request in requests])
 
-        sig = urllib.quote_plus(base64.encodestring(hmac.new(self.securityKey, hashStr, hashlib.sha1).digest()).strip())
+        sig = urllib.quote_plus(base64.encodestring(hmac.new(self.securityKey, str.lower(hashStr), hashlib.sha1).digest()).strip())
 
         requestUrl += "&signature=%s"%sig