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

[1/4] libcloud git commit: Updated code so it's also compatible with Python 2.6

Repository: libcloud
Updated Branches:
  refs/heads/trunk 84735c892 -> 6e1c40654


Updated code so it's also compatible with Python 2.6


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/c07548e7
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/c07548e7
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/c07548e7

Branch: refs/heads/trunk
Commit: c07548e734e3d019c6f7002ae31016d862830148
Parents: 36826f0
Author: Lucas Di Pentima <ld...@veritasgenetics.com>
Authored: Wed Aug 30 18:22:52 2017 -0300
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri Sep 1 22:07:04 2017 +1000

----------------------------------------------------------------------
 libcloud/compute/drivers/ec2.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c07548e7/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index 9737e13..f2526b0 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -3773,9 +3773,9 @@ class BaseEC2NodeDriver(NodeDriver):
         params[tagspec_root + 'ResourceType'] = 'instance'
         tag_nr = 1
         for k, v in tags.items():
-            tag_root = tagspec_root + "Tag.{}.".format(tag_nr)
-            params[tag_root + "Key"] = k
-            params[tag_root + "Value"] = v
+            tag_root = tagspec_root + 'Tag.%d.' % tag_nr
+            params[tag_root + 'Key'] = k
+            params[tag_root + 'Value'] = v
             tag_nr += 1
 
         object = self.connection.request(self.path, params=params).object


[3/4] libcloud git commit: Use TagSpecification parameter on EC2 create_node

Posted by an...@apache.org.
Use TagSpecification parameter on EC2 create_node


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/0d1be1d7
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/0d1be1d7
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/0d1be1d7

Branch: refs/heads/trunk
Commit: 0d1be1d7a28699d726c1256682a4e63889f2a1ba
Parents: 84735c8
Author: Lucas Di Pentima <ld...@veritasgenetics.com>
Authored: Tue Aug 29 19:06:18 2017 -0300
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri Sep 1 22:07:04 2017 +1000

----------------------------------------------------------------------
 libcloud/__init__.py            |  2 +-
 libcloud/compute/drivers/ec2.py | 22 +++++++++++++---------
 2 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/0d1be1d7/libcloud/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/__init__.py b/libcloud/__init__.py
index 24d4a68..773c03f 100644
--- a/libcloud/__init__.py
+++ b/libcloud/__init__.py
@@ -36,7 +36,7 @@ __all__ = [
     '__version__',
     'enable_debug'
 ]
-__version__ = '2.2.0'
+__version__ = '2.2.0.dev1'
 
 
 def enable_debug(fo):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/0d1be1d7/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index efb6275..fd807aa 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -3765,19 +3765,23 @@ class BaseEC2NodeDriver(NodeDriver):
             if subnet_id:
                 params['SubnetId'] = subnet_id
 
+        # Specify tags at instance creation time
+        tags = {'Name': kwargs['name']}
+        if 'ex_metadata' in kwargs:
+            tags.update(kwargs['ex_metadata'])
+        tagspec_root = 'TagSpecification.1.'
+        params[tagspec_root + 'ResourceType'] = 'instance'
+        tag_nr = 1
+        for k, v in tags.iteritems():
+            tag_root = tagspec_root + "Tag.{}.".format(tag_nr)
+            params[tag_root + "Key"] = k
+            params[tag_root + "Value"] = v
+            tag_nr += 1
+
         object = self.connection.request(self.path, params=params).object
         nodes = self._to_nodes(object, 'instancesSet/item')
 
         for node in nodes:
-            tags = {'Name': kwargs['name']}
-            if 'ex_metadata' in kwargs:
-                tags.update(kwargs['ex_metadata'])
-
-            try:
-                self.ex_create_tags(resource=node, tags=tags)
-            except Exception:
-                continue
-
             node.name = kwargs['name']
             node.extra.update({'tags': tags})
 


[2/4] libcloud git commit: Updated code so it's Python 3 compatible.

Posted by an...@apache.org.
Updated code so it's Python 3 compatible.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/36826f00
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/36826f00
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/36826f00

Branch: refs/heads/trunk
Commit: 36826f00f6be5af6e08c53abb84d4a502125c389
Parents: 0d1be1d
Author: Lucas Di Pentima <ld...@veritasgenetics.com>
Authored: Wed Aug 30 18:03:47 2017 -0300
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri Sep 1 22:07:04 2017 +1000

----------------------------------------------------------------------
 libcloud/compute/drivers/ec2.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/36826f00/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index fd807aa..9737e13 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -3772,7 +3772,7 @@ class BaseEC2NodeDriver(NodeDriver):
         tagspec_root = 'TagSpecification.1.'
         params[tagspec_root + 'ResourceType'] = 'instance'
         tag_nr = 1
-        for k, v in tags.iteritems():
+        for k, v in tags.items():
             tag_root = tagspec_root + "Tag.{}.".format(tag_nr)
             params[tag_root + "Key"] = k
             params[tag_root + "Value"] = v


[4/4] libcloud git commit: * Reverted version number. * Removed MockHttp methods as requested on the PR. Closes #1100

Posted by an...@apache.org.
* Reverted version number. * Removed MockHttp methods as requested on the PR.
Closes #1100


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/6e1c4065
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/6e1c4065
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/6e1c4065

Branch: refs/heads/trunk
Commit: 6e1c40654e800a6794142e4ac04629440576e475
Parents: c07548e
Author: Lucas Di Pentima <ld...@veritasgenetics.com>
Authored: Thu Aug 31 15:26:03 2017 -0300
Committer: Anthony Shaw <an...@apache.org>
Committed: Fri Sep 1 22:07:08 2017 +1000

----------------------------------------------------------------------
 libcloud/__init__.py              | 2 +-
 libcloud/test/compute/test_ec2.py | 8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/6e1c4065/libcloud/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/__init__.py b/libcloud/__init__.py
index 773c03f..24d4a68 100644
--- a/libcloud/__init__.py
+++ b/libcloud/__init__.py
@@ -36,7 +36,7 @@ __all__ = [
     '__version__',
     'enable_debug'
 ]
-__version__ = '2.2.0.dev1'
+__version__ = '2.2.0'
 
 
 def enable_debug(fo):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/6e1c4065/libcloud/test/compute/test_ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py
index 2766fc7..f8a2687 100644
--- a/libcloud/test/compute/test_ec2.py
+++ b/libcloud/test/compute/test_ec2.py
@@ -1526,10 +1526,6 @@ class EC2MockHttp(MockHttp):
         body = self.fixtures.load('modify_snapshot_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])
-
     def _CreateVolume(self, method, url, body, headers):
         body = self.fixtures.load('create_volume.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
@@ -1741,10 +1737,6 @@ class EucMockHttp(EC2MockHttp):
                                           headers):
         return self._RunInstances(method, url, body, headers)
 
-    def _services_Eucalyptus_CreateTags(self, method, url, body,
-                                        headers):
-        return self._CreateTags(method, url, body, headers)
-
     def _services_Eucalyptus_DescribeInstanceTypes(self, method, url, body,
                                                    headers):
         body = self.fixtures.load('describe_instance_types.xml')