libcloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject svn commit: r908761 - /incubator/libcloud/trunk/libcloud/drivers/voxel.py
Date Wed, 10 Feb 2010 23:50:07 GMT
Author: jerry
Date: Wed Feb 10 23:50:03 2010
New Revision: 908761

URL: http://svn.apache.org/viewvc?rev=908761&view=rev
Log:
80-col formatting update: drivers/voxel.py

Modified:
    incubator/libcloud/trunk/libcloud/drivers/voxel.py

Modified: incubator/libcloud/trunk/libcloud/drivers/voxel.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/voxel.py?rev=908761&r1=908760&r2=908761&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/voxel.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/voxel.py Wed Feb 10 23:50:03 2010
@@ -18,7 +18,8 @@
 """
 from libcloud.providers import Provider
 from libcloud.types import NodeState, InvalidCredsException
-from libcloud.base import Node, Response, ConnectionUserAndKey, NodeDriver, NodeSize, NodeImage,
NodeLocation
+from libcloud.base import Node, Response, ConnectionUserAndKey, NodeDriver
+from libcloud.base import NodeSize, NodeImage, NodeLocation
 import datetime
 import hashlib
 from xml.etree import ElementTree as ET
@@ -51,7 +52,8 @@
             # 1: Invalid login or password
             # 9: Permission denied: user lacks access rights for this method
             if code == "1" or code == "9":
-                # sucks, but only way to detect bad authentication tokens so far
+                # sucks, but only way to detect
+                # bad authentication tokens so far
                 raise InvalidCredsException(err_list[-1])
         return "\n".join(err_list)
 
@@ -94,9 +96,9 @@
 RAM_PER_CPU = 2048
 
 NODE_STATE_MAP = { 'IN_PROGRESS': NodeState.PENDING,
-                  'SUCCEEDED': NodeState.RUNNING,
-                  'shutting-down': NodeState.TERMINATED,
-                  'terminated': NodeState.TERMINATED }
+                   'SUCCEEDED': NodeState.RUNNING,
+                   'shutting-down': NodeState.TERMINATED,
+                   'terminated': NodeState.TERMINATED }
 
 class VoxelNodeDriver(NodeDriver):
 
@@ -160,12 +162,14 @@
        object = self.connection.request('', params=params).object
 
        if self._getstatus(object):
-           return Node(id = object.findtext("device/id"),
-                       name = kwargs["name"],
-                       state = NODE_STATE_MAP[object.findtext("devices/status")],
-                       public_ip = public_ip,
-                       private_ip = private_ip,
-                       driver = self.connection.driver)
+           return Node(
+               id = object.findtext("device/id"),
+               name = kwargs["name"],
+               state = NODE_STATE_MAP[object.findtext("devices/status")],
+               public_ip = public_ip,
+               private_ip = private_ip,
+               driver = self.connection.driver
+           )
        else:
          return None
 
@@ -201,7 +205,8 @@
        return [NodeLocation(element.attrib["label"],
                             element.findtext("description"),
                             element.findtext("description"),
-                            self) for element in object.findall('facilities/facility')]
+                            self)
+               for element in object.findall('facilities/facility')]
 
    def _to_nodes(self, object):
        nodes = []



Mime
View raw message