Fix Python 2.5 test failure.

Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/4cdf4474
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4cdf4474
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4cdf4474

Branch: refs/heads/trunk
Commit: 4cdf4474856082ce7fbdc9366361c3b33ce031a9
Parents: 56379a3
Author: Tomaz Muraus <[email protected]>
Authored: Thu Jul 25 09:20:46 2013 +0200
Committer: Tomaz Muraus <[email protected]>
Committed: Thu Jul 25 09:20:46 2013 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/ec2.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/4cdf4474/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index c913b5f..4b02b48 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -1335,8 +1335,8 @@ class BaseEC2NodeDriver(NodeDriver):
             if not isinstance(kwargs['ex_blockdevicemappings'], (list, tuple)):
                 raise AttributeError('ex_blockdevicemappings not list or 
tuple')
 
-            for idx, mapping in enumerate(kwargs['ex_blockdevicemappings'],
-                                          start=1):
+            for idx, mapping in enumerate(kwargs['ex_blockdevicemappings']):
+                idx += 1  # we want 1-based indexes
                 if not isinstance(mapping, dict):
                     raise AttributeError('mapping %s in ex_blockdevicemappings 
'
                                          'not a dict' % mapping)

Reply via email to