You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/04/09 02:12:04 UTC

svn commit: r1090495 - in /incubator/libcloud/trunk: libcloud/compute/drivers/ec2.py test/compute/test_ec2.py

Author: tomaz
Date: Sat Apr  9 00:12:03 2011
New Revision: 1090495

URL: http://svn.apache.org/viewvc?rev=1090495&view=rev
Log:
Create "Name" tag after creating an EC2 node.

Modified:
    incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py
    incubator/libcloud/trunk/test/compute/test_ec2.py

Modified: incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py?rev=1090495&r1=1090494&r2=1090495&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py (original)
+++ incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py Sat Apr  9 00:12:03 2011
@@ -821,6 +821,9 @@ class EC2NodeDriver(NodeDriver):
         object = self.connection.request(self.path, params=params).object
         nodes = self._to_nodes(object, 'instancesSet/item')
 
+        for node in nodes:
+            self.ex_create_tags(node=node, tags={'Name': kwargs['name']})
+
         if len(nodes) == 1:
             return nodes[0]
         else:

Modified: incubator/libcloud/trunk/test/compute/test_ec2.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_ec2.py?rev=1090495&r1=1090494&r2=1090495&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_ec2.py (original)
+++ incubator/libcloud/trunk/test/compute/test_ec2.py Sat Apr  9 00:12:03 2011
@@ -284,6 +284,10 @@ class EC2MockHttp(MockHttp):
         body = self.fixtures.load('modify_instance_attribute.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
+    def _idempotent_CreateTags(self, method, url, body, headers):
+        body = self.fixtures.load('create_tags.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
 class EC2APSETests(EC2Tests):
     def setUp(self):
         EC2APSENodeDriver.connectionCls.conn_classes = (None, EC2MockHttp)