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 2015/03/17 14:26:08 UTC

libcloud git commit: LIBCLOUD-676: Allow describing AMI tags

Repository: libcloud
Updated Branches:
  refs/heads/trunk 88e3c822b -> f4a149ec6


LIBCLOUD-676: Allow describing AMI tags

Removed filter that only allows returning tags for ec2 instances

Closes #482

Signed-off-by: Tomaz Muraus <to...@apache.org>


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

Branch: refs/heads/trunk
Commit: f4a149ec6a8b7478fdef645627b1bb445d189469
Parents: 88e3c82
Author: John Kinsella <jl...@stratosec.co>
Authored: Mon Mar 9 16:57:39 2015 -0700
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Mar 17 14:25:44 2015 +0100

----------------------------------------------------------------------
 CHANGES.rst                     | 6 ++++++
 libcloud/compute/drivers/ec2.py | 9 +++++----
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f4a149ec/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index ac6fb1a..a6d032e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -83,6 +83,12 @@ Compute
   (LIBCLOUD-641, GITHUB-477)
   [Wido den Hollander]
 
+- Update ``ex_describe_tags`` method in the EC2 driver and allow user to list
+  tags for any supported resource. Previously you could only list tags for a
+  node or a storage volume.
+  (LIBCLOUD-676, GITHUB-482)
+  [John Kinsella]
+
 DNS
 ~~~
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/f4a149ec/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index a159d4f..b127890 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -3418,10 +3418,12 @@ class BaseEC2NodeDriver(NodeDriver):
 
     def ex_describe_tags(self, resource):
         """
-        Return a dictionary of tags for a resource (Node or StorageVolume).
+        Return a dictionary of tags for a resource (e.g. Node or
+        StorageVolume).
 
         :param  resource: resource which should be used
-        :type   resource: :class:`Node` or :class:`StorageVolume`
+        :type   resource: any resource class, such as :class:`Node,`
+                :class:`StorageVolume,` or :class:NodeImage`
 
         :return: dict Node tags
         :rtype: ``dict``
@@ -3429,8 +3431,7 @@ class BaseEC2NodeDriver(NodeDriver):
         params = {'Action': 'DescribeTags'}
 
         filters = {
-            'resource-id': resource.id,
-            'resource-type': 'instance'
+            'resource-id': resource.id
         }
 
         params.update(self._build_filters(filters))