libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1209935 - in /libcloud/branches/py3k: libcloud/compute/drivers/ libcloud/dns/drivers/ libcloud/storage/drivers/ test/compute/
Date Sat, 03 Dec 2011 15:37:10 GMT
Author: tomaz
Date: Sat Dec  3 15:37:09 2011
New Revision: 1209935

URL: http://svn.apache.org/viewvc?rev=1209935&view=rev
Log:
keys() calls needs to be wrapped inside list().

Modified:
    libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py
    libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py
    libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py
    libcloud/branches/py3k/libcloud/compute/drivers/slicehost.py
    libcloud/branches/py3k/libcloud/compute/drivers/voxel.py
    libcloud/branches/py3k/libcloud/dns/drivers/linode.py
    libcloud/branches/py3k/libcloud/dns/drivers/rackspace.py
    libcloud/branches/py3k/libcloud/dns/drivers/zerigo.py
    libcloud/branches/py3k/libcloud/storage/drivers/google_storage.py
    libcloud/branches/py3k/libcloud/storage/drivers/s3.py
    libcloud/branches/py3k/test/compute/test_cloudsigma.py

Modified: libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py Sat Dec  3 15:37:09 2011
@@ -451,7 +451,8 @@ class CloudSigmaBaseNodeDriver(NodeDrive
                       '^ide:[0-1]:[0-1](:media)?$', '^scsi:0:[0-7](:media)?$', '^block:[0-7](:media)?$')
 
         invalid_keys = []
-        for key in kwargs.keys():
+        keys = list(kwargs.keys())
+        for key in keys:
             matches = False
             for regex in valid_keys:
                 if re.match(regex, key):

Modified: libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/cloudstack.py Sat Dec  3 15:37:09 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=public_ips.get(vm['id'], {}).keys(),
+                public_ips=list(public_ips.get(vm['id'], {})).keys(),
                 private_ips=private_ips,
                 driver=self,
                 extra={

Modified: libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py Sat Dec  3 15:37:09 2011
@@ -333,7 +333,8 @@ class ElasticStackBaseNodeDriver(NodeDri
                       '^scsi:0:[0-7](:media)?$', '^block:[0-7](:media)?$')
 
         invalid_keys = []
-        for key in kwargs.keys():
+        keys = list(kwargs.keys())
+        for key in keys:
             matches = False
             for regex in valid_keys:
                 if re.match(regex, key):

Modified: libcloud/branches/py3k/libcloud/compute/drivers/slicehost.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/slicehost.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/slicehost.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/slicehost.py Sat Dec  3 15:37:09 2011
@@ -193,7 +193,7 @@ class SlicehostNodeDriver(NodeDriver):
         # for consistency with other drivers, we put this in two places.
         node_attrs['password'] = node_attrs['root-password']
         extra = {}
-        for k in node_attrs.keys():
+        for k in list(node_attrs.keys()):
             ek = k.replace("-", "_")
             extra[ek] = node_attrs[k]
         n = Node(id=element.findtext('id'),

Modified: libcloud/branches/py3k/libcloud/compute/drivers/voxel.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/voxel.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/voxel.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/voxel.py Sat Dec  3 15:37:09 2011
@@ -84,7 +84,7 @@ class VoxelConnection(ConnectionUserAndK
             if params[param] is None:
                 del params[param]
 
-        keys = params.keys()
+        keys = list(params.keys())
         keys.sort()
 
         md5 = hashlib.md5()

Modified: libcloud/branches/py3k/libcloud/dns/drivers/linode.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/dns/drivers/linode.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/dns/drivers/linode.py (original)
+++ libcloud/branches/py3k/libcloud/dns/drivers/linode.py Sat Dec  3 15:37:09 2011
@@ -73,7 +73,7 @@ class LinodeDNSDriver(DNSDriver):
     connectionCls = LinodeDNSConnection
 
     def list_record_types(self):
-        return RECORD_TYPE_MAP.keys()
+        return list(RECORD_TYPE_MAP.keys())
 
     def list_zones(self):
         params = {'api_action': 'domain.list'}

Modified: libcloud/branches/py3k/libcloud/dns/drivers/rackspace.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/dns/drivers/rackspace.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/dns/drivers/rackspace.py (original)
+++ libcloud/branches/py3k/libcloud/dns/drivers/rackspace.py Sat Dec  3 15:37:09 2011
@@ -112,7 +112,7 @@ class RackspaceUKDNSConnection(Rackspace
 
 class RackspaceDNSDriver(DNSDriver):
     def list_record_types(self):
-        return RECORD_TYPE_MAP.keys()
+        return list(RECORD_TYPE_MAP.keys())
 
     def list_zones(self):
         response = self.connection.request(action='/domains')

Modified: libcloud/branches/py3k/libcloud/dns/drivers/zerigo.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/dns/drivers/zerigo.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/dns/drivers/zerigo.py (original)
+++ libcloud/branches/py3k/libcloud/dns/drivers/zerigo.py Sat Dec  3 15:37:09 2011
@@ -140,7 +140,7 @@ class ZerigoDNSDriver(DNSDriver):
     connectionCls = ZerigoDNSConnection
 
     def list_record_types(self):
-        return RECORD_TYPE_MAP.keys()
+        return list(RECORD_TYPE_MAP.keys())
 
     def list_zones(self):
         value_dict = {'type': 'zones'}

Modified: libcloud/branches/py3k/libcloud/storage/drivers/google_storage.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/storage/drivers/google_storage.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/storage/drivers/google_storage.py (original)
+++ libcloud/branches/py3k/libcloud/storage/drivers/google_storage.py Sat Dec  3 15:37:09
2011
@@ -97,7 +97,7 @@ class GoogleStorageConnection(Connection
         if not 'content-type' in special_header_values:
             special_header_values['content-type'] = ''
 
-        keys_sorted = special_header_values.keys()
+        keys_sorted = list(special_header_values.keys())
         keys_sorted.sort()
 
         buf = [method]
@@ -106,7 +106,7 @@ class GoogleStorageConnection(Connection
             buf.append(value)
         string_to_sign = '\n'.join(buf)
 
-        keys_sorted = extension_header_values.keys()
+        keys_sorted = list(extension_header_values.keys())
         keys_sorted.sort()
 
         extension_header_string = []

Modified: libcloud/branches/py3k/libcloud/storage/drivers/s3.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/storage/drivers/s3.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/storage/drivers/s3.py (original)
+++ libcloud/branches/py3k/libcloud/storage/drivers/s3.py Sat Dec  3 15:37:09 2011
@@ -129,7 +129,7 @@ class S3Connection(ConnectionUserAndKey)
         if expires:
             special_header_values['date'] = str(expires)
 
-        keys_sorted = special_header_values.keys()
+        keys_sorted = list(special_header_values.keys())
         keys_sorted.sort()
 
         buf = [ method ]
@@ -138,7 +138,7 @@ class S3Connection(ConnectionUserAndKey)
             buf.append(value)
         string_to_sign = '\n'.join(buf)
 
-        keys_sorted = amz_header_values.keys()
+        keys_sorted = list(amz_header_values.keys())
         keys_sorted.sort()
 
         amz_header_string = []

Modified: libcloud/branches/py3k/test/compute/test_cloudsigma.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/test/compute/test_cloudsigma.py?rev=1209935&r1=1209934&r2=1209935&view=diff
==============================================================================
--- libcloud/branches/py3k/test/compute/test_cloudsigma.py (original)
+++ libcloud/branches/py3k/test/compute/test_cloudsigma.py Sat Dec  3 15:37:09 2011
@@ -88,8 +88,8 @@ class CloudSigmaTestCase(unittest.TestCa
     def test_ex_static_ip_create(self):
         result = self.driver.ex_static_ip_create()
         self.assertEqual(len(result), 2)
-        self.assertEqual(len(result[0].keys()), 6)
-        self.assertEqual(len(result[1].keys()), 6)
+        self.assertEqual(len(list(result[0].keys())), 6)
+        self.assertEqual(len(list(result[1].keys())), 6)
 
     def test_ex_static_ip_destroy(self):
         result = self.driver.ex_static_ip_destroy('1.2.3.4')



Mime
View raw message