[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a

Garrett Holmstrom gholms at fedoraproject.org
Sun Jun 16 02:30:56 UTC 2013


The following commit has been merged in the master branch:
commit 974e2af2174a4acb4f993b5d14102872f2e073ff
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Sun Mar 31 19:36:56 2013 -0700

    Implement ApplySecurityGroupsToLoadBalancer
    
    Fixes TOOLS-255

diff --git a/bin/euelb-apply-security-groups-to-lb b/bin/euelb-apply-security-groups-to-lb
new file mode 100755
index 0000000..3c3472a
--- /dev/null
+++ b/bin/euelb-apply-security-groups-to-lb
@@ -0,0 +1,6 @@
+#!/usr/bin/python -tt
+
+import euca2ools.commands.elasticloadbalancing.applysecuritygroupstoloadbalancer
+
+if __name__ == '__main__':
+    euca2ools.commands.elasticloadbalancing.applysecuritygroupstoloadbalancer.ApplySecurityGroupsToLoadBalancer.run()
diff --git a/euca2ools/commands/elasticloadbalancing/registerinstanceswithloadbalancer.py b/euca2ools/commands/elasticloadbalancing/applysecuritygroupstoloadbalancer.py
similarity index 72%
copy from euca2ools/commands/elasticloadbalancing/registerinstanceswithloadbalancer.py
copy to euca2ools/commands/elasticloadbalancing/applysecuritygroupstoloadbalancer.py
index 039a846..2860746 100644
--- a/euca2ools/commands/elasticloadbalancing/registerinstanceswithloadbalancer.py
+++ b/euca2ools/commands/elasticloadbalancing/applysecuritygroupstoloadbalancer.py
@@ -34,21 +34,18 @@ from requestbuilder import Arg
 from requestbuilder.mixins import TabifyingCommand
 
 
-def instance(inst_as_str):
-    return {'InstanceId': inst_as_str}
-
-
-class RegisterInstancesWithLoadBalancer(ELBRequest, TabifyingCommand):
-    DESCRIPTION = 'Add one or more instances to a load balancer'
+class ApplySecurityGroupsToLoadBalancer(ELBRequest, TabifyingCommand):
+    DESCRIPTION = ('[VPC only] Associate one or more security groups with a '
+                   'load balancer.  All previous associations with security '
+                   'groups will be replaced.')
     ARGS = [Arg('LoadBalancerName', metavar='ELB',
                 help='name of the load balancer to modify (required)'),
-            Arg('--instances', dest='Instances.member', required=True,
-                metavar='INSTANCE1,INSTANCE2,...',
-                type=delimited_list(',', item_type=instance),
-                help='''IDs of the instances to register with the load
-                balancer (required)''')]
-    LIST_TAGS = ['Instances']
+            Arg('-g', '--security-groups', dest='SecurityGroups.member',
+                metavar='GROUP1,GROUP2,...', type=delimited_list(','),
+                required=True, help='''security groups to associate the load
+                balancer with (required)''')]
+    LIST_TAGS = ['SecurityGroups']
 
     def print_result(self, result):
-        for instance in result.get('Instances', []):
-            print self.tabify(('INSTANCE', instance.get('InstanceId')))
+        print self.tabify(('SECURITY_GROUPS',
+                           ', '.join(result.get('SecurityGroups', []))))

-- 
managing cloud instances for Eucalyptus



More information about the pkg-eucalyptus-commits mailing list