libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbogorods...@apache.org
Subject svn commit: r1104046 - /incubator/libcloud/trunk/example_loadbalancer.py
Date Tue, 17 May 2011 08:14:48 GMT
Author: rbogorodskiy
Date: Tue May 17 08:14:47 2011
New Revision: 1104046

URL: http://svn.apache.org/viewvc?rev=1104046&view=rev
Log:
Minor style fixes for loadbalancer example.

Modified:
    incubator/libcloud/trunk/example_loadbalancer.py

Modified: incubator/libcloud/trunk/example_loadbalancer.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/example_loadbalancer.py?rev=1104046&r1=1104045&r2=1104046&view=diff
==============================================================================
--- incubator/libcloud/trunk/example_loadbalancer.py (original)
+++ incubator/libcloud/trunk/example_loadbalancer.py Tue May 17 08:14:47 2011
@@ -18,7 +18,7 @@
 import os
 import time
 
-from libcloud.loadbalancer.base import LoadBalancer, Member, Algorithm
+from libcloud.loadbalancer.base import Member, Algorithm
 from libcloud.loadbalancer.types import Provider, State
 from libcloud.loadbalancer.providers import get_driver
 
@@ -29,6 +29,8 @@ def main():
 
     balancers = driver.list_balancers()
 
+    print balancers
+
     # creating a balancer which balances traffic across two
     # nodes: 192.168.86.1:80 and 192.168.86.2:8080. Balancer
     # itself listens on port 80/tcp
@@ -52,14 +54,15 @@ def main():
         if balancer.state == State.RUNNING:
             break
 
+        print "sleeping for 30 seconds for balancers to become ready"
         time.sleep(30)
 
-    # fetch list of nodes
-    nodes = balancer.list_members()
-    print nodes
+    # fetch list of members
+    members = balancer.list_members()
+    print members
 
-    # remove first node
-    balancer.detach_member(nodes[0])
+    # remove first member
+    balancer.detach_member(members[0])
 
     # and add another one: 10.0.0.10:1000
     print balancer.attach_member(Member(None, ip='10.0.0.10', port='1000'))



Mime
View raw message