You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by pq...@apache.org on 2010/01/05 06:14:56 UTC

svn commit: r895905 - /incubator/libcloud/trunk/libcloud/drivers/slicehost.py

Author: pquerna
Date: Tue Jan  5 05:14:55 2010
New Revision: 895905

URL: http://svn.apache.org/viewvc?rev=895905&view=rev
Log:
Add list_locations for slicehost

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

Modified: incubator/libcloud/trunk/libcloud/drivers/slicehost.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/slicehost.py?rev=895905&r1=895904&r2=895905&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/slicehost.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/slicehost.py Tue Jan  5 05:14:55 2010
@@ -16,7 +16,7 @@
 Slicehost Driver
 """
 from libcloud.types import NodeState, InvalidCredsException, Provider
-from libcloud.base import ConnectionKey, Response, NodeDriver, Node, NodeSize, NodeImage
+from libcloud.base import ConnectionKey, Response, NodeDriver, Node, NodeSize, NodeImage, NodeLocation
 import base64
 import httplib
 import struct
@@ -75,6 +75,10 @@
     def list_images(self):
         return self._to_images(self.connection.request('/images.xml').object)
 
+    def list_locations(self):
+        # TODO: This isn't accurate. Some Slices are in Dallas, some are in St Louis (?)
+        return [NodeLocation(0, "Slicehost Central US", 'us', self)]
+
     def create_node(self, **kwargs):
         name = kwargs['name']
         image = kwargs['image']