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:59 UTC

svn commit: r895906 - /incubator/libcloud/trunk/libcloud/drivers/ec2.py

Author: pquerna
Date: Tue Jan  5 05:14:59 2010
New Revision: 895906

URL: http://svn.apache.org/viewvc?rev=895906&view=rev
Log:
Add list locations to amazon driver

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

Modified: incubator/libcloud/trunk/libcloud/drivers/ec2.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/ec2.py?rev=895906&r1=895905&r2=895906&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/ec2.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/ec2.py Tue Jan  5 05:14:59 2010
@@ -18,7 +18,7 @@
 """
 from libcloud.providers import Provider
 from libcloud.types import NodeState, InvalidCredsException
-from libcloud.base import Node, Response, ConnectionUserAndKey, NodeDriver, NodeSize, NodeImage
+from libcloud.base import Node, Response, ConnectionUserAndKey, NodeDriver, NodeSize, NodeImage, NodeLocation
 import base64
 import hmac
 import httplib
@@ -282,6 +282,9 @@
         res = self.connection.request('/', params=params).object
         return self._get_terminate_boolean(res)
 
+    def list_locations(self):
+        return [NodeLocation(0, "Amazon US East", 'US', self)]
+
 class EC2EUConnection(EC2Connection):
 
     host = EC2_EU_HOST
@@ -290,3 +293,5 @@
 
     connectionCls = EC2EUConnection
     _instance_types = EC2_EU_INSTANCE_TYPES
+    def list_locations(self):
+        return [NodeLocation(0, "Amazon Europe", 'IE', self)]