libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1103111 - in /incubator/libcloud/trunk/libcloud/loadbalancer/drivers: gogrid.py rackspace.py
Date Sat, 14 May 2011 13:48:44 GMT
Author: tomaz
Date: Sat May 14 13:48:44 2011
New Revision: 1103111

URL: http://svn.apache.org/viewvc?rev=1103111&view=rev
Log:
Update the create_balancer method in rackspace driver.

Modified:
    incubator/libcloud/trunk/libcloud/loadbalancer/drivers/gogrid.py
    incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.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=1103111&r1=1103110&r2=1103111&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/loadbalancer/drivers/gogrid.py (original)
+++ incubator/libcloud/trunk/libcloud/loadbalancer/drivers/gogrid.py Sat May 14 13:48:44 2011
@@ -46,7 +46,7 @@ class GoGridLBDriver(BaseGoGridDriver, D
                 self.connection.request('/api/grid/loadbalancer/list').object)
 
     def ex_create_balancer_nowait(self, name, members, protocol='http', port=80,
-                                  algorithm=Algorithm.ROUND_ROBIN):
+                                  algorithm=DEFAULT_ALGORITHM):
         algorithm = self._algorithm_to_value(algorithm)
 
         params = {'name': name,

Modified: incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.py?rev=1103111&r1=1103110&r2=1103111&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.py (original)
+++ incubator/libcloud/trunk/libcloud/loadbalancer/drivers/rackspace.py Sat May 14 13:48:44
2011
@@ -23,6 +23,7 @@ except ImportError:
 from libcloud.utils import reverse_dict
 from libcloud.common.base import Response
 from libcloud.loadbalancer.base import LoadBalancer, Member, Driver, Algorithm
+from libcloud.loadbalancer.base import DEFAULT_ALGORITHM
 from libcloud.loadbalancer.types import Provider, State
 from libcloud.common.rackspace import (AUTH_HOST_US,
         RackspaceBaseConnection)
@@ -83,17 +84,13 @@ class RackspaceLBDriver(Driver):
         return self._to_balancers(
                 self.connection.request('/loadbalancers').object)
 
-    def create_balancer(self, name, port, algorithm, members):
-        if not algorithm:
-            algorithm = DEFAULT_ALGORITHM
-        else:
-            algorithm = self._algorithm_to_value(algorithm)
-
+    def create_balancer(self, name, members, protocol='http',
+                        port=80, algorithm=DEFAULT_ALGORITHM):
         balancer_object = {"loadBalancer":
                 {"name": name,
                     "port": port,
                     "algorithm": algorithm,
-                    "protocol": "HTTP",
+                    "protocol": protocol.upper(),
                     "virtualIps": [{"type": "PUBLIC"}],
                     "nodes": [{"address": member.ip,
                         "port": member.port,



Mime
View raw message