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/975fc997
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/975fc997
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/975fc997

Branch: refs/heads/master
Commit: 975fc997f710f51ec4dd91c8fd98480d61c892a7
Parents: 21ee898
Author: Hugo Trippaers <[email protected]>
Authored: Sat Sep 22 13:43:57 2012 +0200
Committer: Hugo Trippaers <[email protected]>
Committed: Sat Sep 22 13:43:57 2012 +0200

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/975fc997/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
 

Reply via email to