libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1103058 - in /incubator/libcloud/trunk: libcloud/loadbalancer/drivers/rackspace.py test/loadbalancer/test_rackspace.py
Date Sat, 14 May 2011 11:39:09 GMT
Author: tomaz
Date: Sat May 14 11:39:09 2011
New Revision: 1103058

URL: http://svn.apache.org/viewvc?rev=1103058&view=rev
Log:
Do the same with the balancer_detail method in the Rackspace LB driver.

Modified:
    incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.py
    incubator/libcloud/trunk/test/loadbalancer/test_rackspace.py

Modified: incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.py?rev=1103058&r1=1103057&r2=1103058&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.py (original)
+++ incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.py Sat May 14 11:39:09
2011
@@ -103,12 +103,7 @@ class RackspaceLBDriver(LBDriver):
 
         return resp.status == 202
 
-    def balancer_detail(self, **kwargs):
-        try:
-            balancer_id = kwargs['balancer_id']
-        except KeyError:
-            balancer_id = kwargs['balancer'].id
-
+    def get_balancer(self, balancer_id):
         uri = '/loadbalancers/%s' % (balancer_id)
         resp = self.connection.request(uri)
 

Modified: incubator/libcloud/trunk/test/loadbalancer/test_rackspace.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/loadbalancer/test_rackspace.py?rev=1103058&r1=1103057&r2=1103058&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/loadbalancer/test_rackspace.py (original)
+++ incubator/libcloud/trunk/test/loadbalancer/test_rackspace.py Sat May 14 11:39:09 2011
@@ -42,14 +42,14 @@ class RackspaceLBTests(unittest.TestCase
         ret = self.driver.destroy_balancer(balancer)
         self.assertTrue(ret)
 
-    def test_balancer_detail(self):
-        balancer = self.driver.balancer_detail(balancer_id='8290')
+    def test_get_balancer(self):
+        balancer = self.driver.get_balancer(balancer_id='8290')
 
         self.assertEquals(balancer.name, 'test2')
         self.assertEquals(balancer.id, '8290')
 
     def test_balancer_list_members(self):
-        balancer = self.driver.balancer_detail(balancer_id='8290')
+        balancer = self.driver.get_balancer(balancer_id='8290')
         members = balancer.list_members()
 
         self.assertEquals(len(members), 2)
@@ -57,14 +57,14 @@ class RackspaceLBTests(unittest.TestCase
                 set(["%s:%s" % (member.ip, member.port) for member in members]))
 
     def test_balancer_attach_member(self):
-        balancer = self.driver.balancer_detail(balancer_id='8290')
+        balancer = self.driver.get_balancer(balancer_id='8290')
         member = balancer.attach_member(LBMember(None, ip='10.1.0.12', port='80'))
 
         self.assertEquals(member.ip, '10.1.0.12')
         self.assertEquals(member.port, 80)
 
     def test_balancer_detach_member(self):
-        balancer = self.driver.balancer_detail(balancer_id='8290')
+        balancer = self.driver.get_balancer(balancer_id='8290')
         member = balancer.list_members()[0]
 
         ret = balancer.detach_member(member)



Mime
View raw message