CLOUDSTACK-2020: Make cli's requester unicode friendly

Fixed list processing that uses lambdas to use x.lower() assuming x is string,
and not forced/caster str.lower(obj)

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-04-16 10:40:02 +05:30
parent 51b4ee26ec
commit 7bff1d08f4
1 changed files with 2 additions and 2 deletions

View File

@ -61,11 +61,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])