You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by je...@apache.org on 2010/02/09 14:49:38 UTC
svn commit: r908025 - /incubator/libcloud/trunk/libcloud/drivers/gogrid.py
Author: jerry
Date: Tue Feb 9 13:49:38 2010
New Revision: 908025
URL: http://svn.apache.org/viewvc?rev=908025&view=rev
Log:
80-col formatting update: drivers/gogrid.py
Modified:
incubator/libcloud/trunk/libcloud/drivers/gogrid.py
Modified: incubator/libcloud/trunk/libcloud/drivers/gogrid.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/gogrid.py?rev=908025&r1=908024&r2=908025&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/gogrid.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/gogrid.py Tue Feb 9 13:49:38 2010
@@ -17,7 +17,8 @@
"""
from libcloud.providers import Provider
from libcloud.types import NodeState, InvalidCredsException
-from libcloud.base import Node, ConnectionUserAndKey, Response, NodeDriver, NodeSize, NodeImage, NodeLocation
+from libcloud.base import Node, ConnectionUserAndKey, Response, NodeDriver
+from libcloud.base import NodeSize, NodeImage, NodeLocation
import time
import hashlib
@@ -108,10 +109,15 @@
return m.hexdigest()
class GoGridNode(Node):
- # Generating uuid based on public ip to get around missing id on create_node in gogrid api
- # Used public ip since it is not mutable and specified at create time, so uuid of node should not change after add is completed
+ # Generating uuid based on public ip to get around missing id on
+ # create_node in gogrid api
+ #
+ # Used public ip since it is not mutable and specified at create time,
+ # so uuid of node should not change after add is completed
def get_uuid(self):
- return hashlib.sha1("%s:%d" % (self.public_ip,self.driver.type)).hexdigest()
+ return hashlib.sha1(
+ "%s:%d" % (self.public_ip,self.driver.type)
+ ).hexdigest()
class GoGridNodeDriver(NodeDriver):
@@ -221,7 +227,8 @@
'server.ram': size.id,
'ip':first_ip}
- object = self.connection.request('/api/grid/server/add', params=params).object
+ object = self.connection.request('/api/grid/server/add',
+ params=params).object
node = self._to_node(object['list'][0])
return node