incubator-libcloud mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roman Bogorodskiy <>
Subject [libcloud] GoGrid driver regression?
Date Fri, 07 May 2010 09:46:24 GMT

Looks like a regression has been introduced to the gogrid driver by this

The thing is that GoGrid doesn't provide ID for the just created node,
so adding new node fails with the following exception:

  File "/usr/local/lib/python2.6/dist-packages/libcloud/drivers/", line 241, in create_node
    node = self._to_node(object['list'][0])
  File "/usr/local/lib/python2.6/dist-packages/libcloud/drivers/", line 152, in _to_node
    id = self._get_id(element)
  File "/usr/local/lib/python2.6/dist-packages/libcloud/drivers/", line 147, in _get_id
    return element['id']
KeyError: 'id'

After reverting this change with some minor changes:

--- a/libcloud/drivers/
+++ b/libcloud/drivers/
@@ -143,8 +143,8 @@ class GoGridNodeDriver(NodeDriver):
     def _get_ip(self, element):
         return element['ip']['ip']
-    def _get_id(self,element):
-        return element['id']
+    def _get_id(self, element):
+        return element.get('id')
     def _to_node(self, element):
         state = self._get_state(element)

It started to work fine.

Copy of the diff:

Roman Bogorodskiy

View raw message