libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1209936 - in /libcloud/branches/py3k: libcloud/common/cloudstack.py libcloud/compute/drivers/cloudstack.py test/compute/test_cloudstack.py
Date Sat, 03 Dec 2011 15:40:05 GMT
Author: tomaz
Date: Sat Dec  3 15:40:05 2011
New Revision: 1209936

URL: http://svn.apache.org/viewvc?rev=1209936&view=rev
Log:
CloudStack driver tests now pass.

Modified:
    libcloud/branches/py3k/libcloud/common/cloudstack.py
    libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py
    libcloud/branches/py3k/test/compute/test_cloudstack.py

Modified: libcloud/branches/py3k/libcloud/common/cloudstack.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/common/cloudstack.py?rev=1209936&r1=1209935&r2=1209936&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/common/cloudstack.py (original)
+++ libcloud/branches/py3k/libcloud/common/cloudstack.py Sat Dec  3 15:40:05 2011
@@ -17,7 +17,9 @@ import base64
 import hashlib
 import hmac
 import time
-import urllib
+
+from libcloud.py3 import urllib
+from libcloud.py3 import b
 
 from libcloud.common.base import ConnectionUserAndKey, PollingConnection
 from libcloud.common.base import JsonResponse
@@ -40,8 +42,8 @@ class CloudStackConnection(ConnectionUse
         signature.sort(key=lambda x: x[0])
         signature = urllib.urlencode(signature)
         signature = signature.lower().replace('+', '%20')
-        signature = hmac.new(self.key, msg=signature, digestmod=hashlib.sha1)
-        return base64.b64encode(signature.digest())
+        signature = hmac.new(b(self.key), msg=b(signature), digestmod=hashlib.sha1)
+        return base64.b64encode(b(signature.digest()))
 
     def add_default_params(self, params):
         params['apiKey'] = self.user_id

Modified: libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py?rev=1209936&r1=1209935&r2=1209936&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py Sat Dec  3 15:40:05 2011
@@ -162,7 +162,7 @@ class CloudStackNodeDriver(CloudStackDri
                 id=vm['id'],
                 name=vm.get('displayname', None),
                 state=self.NODE_STATE_MAP[vm['state']],
-                public_ips=list(public_ips.get(vm['id'], {})).keys(),
+                public_ips=public_ips.get(vm['id'], {}).keys(),
                 private_ips=private_ips,
                 driver=self,
                 extra={

Modified: libcloud/branches/py3k/test/compute/test_cloudstack.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/test/compute/test_cloudstack.py?rev=1209936&r1=1209935&r2=1209936&view=diff
==============================================================================
--- libcloud/branches/py3k/test/compute/test_cloudstack.py (original)
+++ libcloud/branches/py3k/test/compute/test_cloudstack.py Sat Dec  3 15:40:05 2011
@@ -1,7 +1,8 @@
-from libcloud.py3 import httplib
 import sys
 import unittest
-import urlparse
+
+from libcloud.py3 import httplib
+from libcloud.py3 import urlparse
 
 try:
     import simplejson as json



Mime
View raw message