libcloud-notifications mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1103056&view=rev
Log:
Rename the balancer_details method to get_balancer and refactor id.

Modified:
    incubator/libcloud/trunk/libcloud/loadbalancer/drivers/gogrid.py
    incubator/libcloud/trunk/test/loadbalancer/test_gogrid.py

Modified: incubator/libcloud/trunk/libcloud/loadbalancer/drivers/gogrid.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/loadbalancer/drivers/gogrid.py?rev=1103056&r1=1103055&r2=1103056&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/loadbalancer/drivers/gogrid.py (original)
+++ incubator/libcloud/trunk/libcloud/loadbalancer/drivers/gogrid.py Sat May 14 11:35:39 2011
@@ -93,17 +93,13 @@ class GoGridLBDriver(BaseGoGridDriver, L
 
         return resp.status == 200
 
-    def balancer_detail(self, **kwargs):
+    def get_balancer(self, **kwargs):
         params = {}
 
         try:
-            params['name'] = kwargs['balancer_name']
+            params['name'] = kwargs['ex_balancer_name']
         except KeyError:
-            try:
-                balancer_id = kwargs['balancer_id']
-            except KeyError:
-                balancer_id = kwargs['balancer'].id
-
+            balancer_id = kwargs['balancer_id']
             params['id'] = balancer_id
 
         resp = self.connection.request('/api/grid/loadbalancer/get',

Modified: incubator/libcloud/trunk/test/loadbalancer/test_gogrid.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/loadbalancer/test_gogrid.py?rev=1103056&r1=1103055&r2=1103056&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/loadbalancer/test_gogrid.py (original)
+++ incubator/libcloud/trunk/test/loadbalancer/test_gogrid.py Sat May 14 11:35:39 2011
@@ -43,14 +43,14 @@ class GoGridTests(unittest.TestCase):
         ret = self.driver.destroy_balancer(balancer)
         self.assertTrue(ret)
 
-    def test_balancer_detail(self):
-        balancer = self.driver.balancer_detail(balancer_id='23530')
+    def test_get_balancer(self):
+        balancer = self.driver.get_balancer(balancer_id='23530')
 
         self.assertEquals(balancer.name, 'test2')
         self.assertEquals(balancer.id, '23530')
 
     def test_balancer_list_members(self):
-        balancer = self.driver.balancer_detail(balancer_id='23530')
+        balancer = self.driver.get_balancer(balancer_id='23530')
         members = balancer.list_members()
 
         expected_members = set([u'10.0.0.78:80', u'10.0.0.77:80',



Mime
View raw message