libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1209926 - in /libcloud/branches/py3k: libcloud/ libcloud/common/ libcloud/compute/drivers/ libcloud/storage/drivers/ test/compute/
Date Sat, 03 Dec 2011 15:00:56 GMT
Author: tomaz
Date: Sat Dec  3 15:00:55 2011
New Revision: 1209926

URL: http://svn.apache.org/viewvc?rev=1209926&view=rev
Log:
Use items() instead of iteritems().

Modified:
    libcloud/branches/py3k/libcloud/common/base.py
    libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py
    libcloud/branches/py3k/libcloud/compute/drivers/dreamhost.py
    libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py
    libcloud/branches/py3k/libcloud/compute/drivers/gogrid.py
    libcloud/branches/py3k/libcloud/compute/drivers/softlayer.py
    libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py
    libcloud/branches/py3k/libcloud/storage/drivers/dummy.py
    libcloud/branches/py3k/libcloud/storage/drivers/google_storage.py
    libcloud/branches/py3k/libcloud/storage/drivers/s3.py
    libcloud/branches/py3k/libcloud/utils.py
    libcloud/branches/py3k/test/compute/test_elasticstack.py

Modified: libcloud/branches/py3k/libcloud/common/base.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/common/base.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/common/base.py (original)
+++ libcloud/branches/py3k/libcloud/common/base.py Sat Dec  3 15:00:55 2011
@@ -478,7 +478,7 @@ class Connection(object):
             if raw:
                 self.connection.putrequest(method, url)
 
-                for key, value in headers.iteritems():
+                for key, value in headers.items():
                     self.connection.putheader(key, str(value))
 
                 self.connection.endheaders()

Modified: libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/cloudsigma.py Sat Dec  3 15:00:55 2011
@@ -259,7 +259,7 @@ class CloudSigmaBaseNodeDriver(NodeDrive
         Return a list of available node sizes.
         """
         sizes = []
-        for key, value in INSTANCE_TYPES.iteritems():
+        for key, value in INSTANCE_TYPES.items():
             size = CloudSigmaNodeSize(id = value['id'], name = value['name'],
                                       cpu = value['cpu'], ram = value['memory'],
                                       disk = value['disk'], bandwidth = value['bandwidth'],
@@ -374,7 +374,7 @@ class CloudSigmaBaseNodeDriver(NodeDrive
         node = self._get_node_info(node)
 
         drive_uuids = []
-        for key, value in node.iteritems():
+        for key, value in node.items():
             if (key.startswith('ide:') or key.startswith('scsi') or key.startswith('block'))
and \
                not (key.endswith(':bytes') or key.endswith(':requests') or key.endswith('media')):
                 drive_uuids.append(value)

Modified: libcloud/branches/py3k/libcloud/compute/drivers/dreamhost.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/dreamhost.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/dreamhost.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/dreamhost.py Sat Dec  3 15:00:55 2011
@@ -198,7 +198,7 @@ class DreamhostNodeDriver(NodeDriver):
 
     def list_sizes(self, **kwargs):
         sizes = []
-        for key, values in self._sizes.iteritems():
+        for key, values in self._sizes.items():
             attributes = copy.deepcopy(values)
             attributes.update({ 'price': self._get_size_price(size_id=key) })
             sizes.append(NodeSize(driver=self.connection.driver, **attributes))

Modified: libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/elasticstack.py Sat Dec  3 15:00:55 2011
@@ -182,7 +182,7 @@ class ElasticStackBaseNodeDriver(NodeDri
     def list_images(self, location=None):
         # Returns a list of available pre-installed system drive images
         images = []
-        for key, value in self._standard_drives.iteritems():
+        for key, value in self._standard_drives.items():
             image = NodeImage(
                 id=value['uuid'],
                 name=value['description'],
@@ -197,7 +197,7 @@ class ElasticStackBaseNodeDriver(NodeDri
 
     def list_sizes(self, location=None):
         sizes = []
-        for key, value in INSTANCE_TYPES.iteritems():
+        for key, value in INSTANCE_TYPES.items():
             size = ElasticStackNodeSize(
                 id=value['id'],
                 name=value['name'], cpu=value['cpu'], ram=value['memory'],

Modified: libcloud/branches/py3k/libcloud/compute/drivers/gogrid.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/gogrid.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/gogrid.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/gogrid.py Sat Dec  3 15:00:55 2011
@@ -218,7 +218,7 @@ class GoGridNodeDriver(BaseGoGridDriver,
 
     def list_sizes(self, location=None):
         sizes = []
-        for key, values in self._instance_types.iteritems():
+        for key, values in self._instance_types.items():
             attributes = copy.deepcopy(values)
             attributes.update({ 'price': self._get_size_price(size_id=key) })
             sizes.append(NodeSize(driver=self.connection.driver, **attributes))

Modified: libcloud/branches/py3k/libcloud/compute/drivers/softlayer.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/softlayer.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/softlayer.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/softlayer.py Sat Dec  3 15:00:55 2011
@@ -396,7 +396,7 @@ class SoftLayerNodeDriver(NodeDriver):
         )
 
     def list_sizes(self, location=None):
-        return [self._to_size(id, s['imagedata']) for id, s in SL_TEMPLATES.iteritems()]
+        return [self._to_size(id, s['imagedata']) for id, s in SL_TEMPLATES.items()]
 
     def _to_loc(self, loc):
         return NodeLocation(

Modified: libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py (original)
+++ libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py Sat Dec  3 15:00:55 2011
@@ -383,7 +383,7 @@ class CloudFilesStorageDriver(StorageDri
 
         headers = {}
         if meta_data:
-            for key, value in meta_data.iteritems():
+            for key, value in meta_data.items():
                 key = 'X-Object-Meta-%s' % (key)
                 headers[key] = value
 
@@ -492,7 +492,7 @@ class CloudFilesStorageDriver(StorageDri
         content_type = headers.pop('content-type', None)
 
         meta_data = {}
-        for key, value in headers.iteritems():
+        for key, value in headers.items():
             if key.find('x-object-meta-') != -1:
                 key = key.replace('x-object-meta-', '')
                 meta_data[key] = value

Modified: libcloud/branches/py3k/libcloud/storage/drivers/dummy.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/storage/drivers/dummy.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/storage/drivers/dummy.py (original)
+++ libcloud/branches/py3k/libcloud/storage/drivers/dummy.py Sat Dec  3 15:00:55 2011
@@ -105,7 +105,7 @@ class DummyStorageDriver(StorageDriver):
         bytes_used = 0
         for container in self._containers:
             objects = self._containers[container]['objects']
-            for _, obj in objects.iteritems():
+            for _, obj in objects.items():
                 bytes_used += obj.size
 
         return { 'container_count': int(container_count),

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=1209926&r1=1209925&r2=1209926&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:00:55
2011
@@ -81,7 +81,7 @@ class GoogleStorageConnection(Connection
         extension_header_values = {}
 
         headers_copy = copy.deepcopy(headers)
-        for key, value in headers_copy.iteritems():
+        for key, value in headers_copy.items():
             if key.lower() in special_header_keys:
                 if key.lower() == 'date':
                     value = value.strip()

Modified: libcloud/branches/py3k/libcloud/storage/drivers/s3.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/storage/drivers/s3.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/storage/drivers/s3.py (original)
+++ libcloud/branches/py3k/libcloud/storage/drivers/s3.py Sat Dec  3 15:00:55 2011
@@ -114,7 +114,7 @@ class S3Connection(ConnectionUserAndKey)
         amz_header_values = {}
 
         headers_copy = copy.deepcopy(headers)
-        for key, value in headers_copy.iteritems():
+        for key, value in headers_copy.items():
             if key.lower() in special_header_keys:
                 special_header_values[key.lower()] = value.lower().strip()
             elif key.lower().startswith('x-amz-'):
@@ -375,7 +375,7 @@ class S3StorageDriver(StorageDriver):
         meta_data = extra.get('meta_data', None)
 
         if meta_data:
-            for key, value in meta_data.iteritems():
+            for key, value in meta_data.items():
                 key = 'x-amz-meta-%s' % (key)
                 headers[key] = value
 

Modified: libcloud/branches/py3k/libcloud/utils.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/utils.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/utils.py (original)
+++ libcloud/branches/py3k/libcloud/utils.py Sat Dec  3 15:00:55 2011
@@ -252,7 +252,7 @@ def findall(element, xpath, namespace=No
 
 
 def reverse_dict(dictionary):
-    return dict([(value, key) for key, value in dictionary.iteritems()])
+    return dict([(value, key) for key, value in dictionary.items()])
 
 
 def get_driver(drivers, provider):

Modified: libcloud/branches/py3k/test/compute/test_elasticstack.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/test/compute/test_elasticstack.py?rev=1209926&r1=1209925&r2=1209926&view=diff
==============================================================================
--- libcloud/branches/py3k/test/compute/test_elasticstack.py (original)
+++ libcloud/branches/py3k/test/compute/test_elasticstack.py Sat Dec  3 15:00:55 2011
@@ -119,7 +119,7 @@ class ElasticStackTestCase(object):
         images = self.driver.list_images()
         self.assertEqual(len(images), len(self.driver._standard_drives))
 
-        for uuid, values in self.driver._standard_drives.iteritems():
+        for uuid, values in self.driver._standard_drives.items():
             self.assertEqual(len([image for image in images if image.id == uuid]), 1)
 
     def test_reboot_node(self):



Mime
View raw message