libcloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject svn commit: r907891 - /incubator/libcloud/trunk/libcloud/drivers/ec2.py
Date Tue, 09 Feb 2010 03:00:00 GMT
Author: jerry
Date: Tue Feb  9 02:59:59 2010
New Revision: 907891

URL: http://svn.apache.org/viewvc?rev=907891&view=rev
Log:
drivers.ec2 create_node docstring (ref: LIBCLOUD-7)

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=907891&r1=907890&r2=907891&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/ec2.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/ec2.py Tue Feb  9 02:59:59 2010
@@ -338,16 +338,40 @@
                 raise e
         return results
 
-    # name doesn't apply to EC2 nodes.
     def create_node(self, **kwargs):
+        """Create a new EC2 node
+
+        See L{NodeDriver.create_node} for more keyword args.
+        Reference: http://bit.ly/8ZyPSy [docs.amazonwebservices.com]
+
+        @keyword    name: Name (unused by EC2)
+        @type       name: C{str}
+
+        @keyword    mincount: Minimum number of instances to launch
+        @type       mincount: C{int}
+
+        @keyword    maxcount: Maximum number of instances to launch
+        @type       maxcount: C{int}
+
+        @keyword    securitygroup: Name of security group
+        @type       securitygroup: C{str}
+
+        @keyword    keyname: The name of the key pair
+        @type       keyname: C{str}
+
+        @keyword    userdata: User data
+        @type       userdata: C{str}
+        """
         name = kwargs["name"]
         image = kwargs["image"]
         size = kwargs["size"]
-        params = {'Action': 'RunInstances',
-                  'ImageId': image.id,
-                  'MinCount': kwargs.get('mincount','1'),
-                  'MaxCount': kwargs.get('maxcount','1'),
-                  'InstanceType': size.id}
+        params = {
+            'Action': 'RunInstances',
+            'ImageId': image.id,
+            'MinCount': kwargs.get('mincount','1'),
+            'MaxCount': kwargs.get('maxcount','1'),
+            'InstanceType': size.id
+        }
 
         if 'securitygroup' in kwargs:
             params['SecurityGroup'] = kwargs['securitygroup']
@@ -363,7 +387,8 @@
 
         if len(nodes) == 1:
             return nodes[0]
-        else: return nodes
+        else:
+            return nodes
 
     def reboot_node(self, node):
         """



Mime
View raw message