libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r925412 - /incubator/libcloud/trunk/libcloud/drivers/ec2.py
Date Fri, 19 Mar 2010 20:43:59 GMT
Author: pquerna
Date: Fri Mar 19 20:43:59 2010
New Revision: 925412

URL: http://svn.apache.org/viewvc?rev=925412&view=rev
Log:
Add support for multiple security groups to the ec2 driver.

Modified:
    incubator/libcloud/trunk/libcloud/drivers/ec2.py

Modified: incubator/libcloud/trunk/libcloud/drivers/ec2.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/ec2.py?rev=925412&r1=925411&r2=925412&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/ec2.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/ec2.py Fri Mar 19 20:43:59 2010
@@ -31,7 +31,8 @@ EC2_US_EAST_HOST = 'ec2.us-east-1.amazon
 EC2_US_WEST_HOST = 'ec2.us-west-1.amazonaws.com'
 EC2_EU_WEST_HOST = 'ec2.eu-west-1.amazonaws.com'
 
-API_VERSION = '2009-04-04'
+API_VERSION = '2009-11-30'
+
 NAMESPACE = "http://ec2.amazonaws.com/doc/%s/" % (API_VERSION)
 
 """
@@ -376,7 +377,10 @@ class EC2NodeDriver(NodeDriver):
         }
 
         if 'securitygroup' in kwargs:
-            params['SecurityGroup'] = kwargs['securitygroup']
+            if not isinstance(kwargs['securitygroup'], list):
+              kwargs['securitygroup'] = [kwargs['securitygroup']]
+            for sig in range(len(kwargs['securitygroup'])):
+              params['SecurityGroup.%d' % (sig+1,)]  = kwargs['securitygroup'][sig]
 
         if 'keyname' in kwargs:
             params['KeyName'] = kwargs['keyname']



Mime
View raw message