Repository: libcloud Updated Branches: refs/heads/trunk 2d4a6d32d -> 5268f2b77
check for None as tag value and just use tag name when deleting Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/adb75493 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/adb75493 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/adb75493 Branch: refs/heads/trunk Commit: adb75493f05019666e623d56eeb29c0091129e38 Parents: 2d4a6d3 Author: Ian White <ianw@Ians-iMac.local> Authored: Tue Aug 9 11:46:43 2016 -0500 Committer: Anthony Shaw <anthonys...@apache.org> Committed: Thu Aug 11 15:40:27 2016 +1000 ---------------------------------------------------------------------- libcloud/compute/drivers/ec2.py | 3 ++- libcloud/test/compute/test_ec2.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/adb75493/libcloud/compute/drivers/ec2.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py index 93857ef..34ba97c 100644 --- a/libcloud/compute/drivers/ec2.py +++ b/libcloud/compute/drivers/ec2.py @@ -4310,7 +4310,8 @@ class BaseEC2NodeDriver(NodeDriver): 'ResourceId.0': resource.id} for i, key in enumerate(tags): params['Tag.%d.Key' % i] = key - params['Tag.%d.Value' % i] = tags[key] + if tags[key] != None: + params['Tag.%d.Value' % i] = tags[key] res = self.connection.request(self.path, params=params.copy()).object http://git-wip-us.apache.org/repos/asf/libcloud/blob/adb75493/libcloud/test/compute/test_ec2.py ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py index 7fe69c3..2716be2 100644 --- a/libcloud/test/compute/test_ec2.py +++ b/libcloud/test/compute/test_ec2.py @@ -681,6 +681,11 @@ class EC2Tests(LibcloudTestCase, TestCaseMixin): def test_ex_delete_tags(self): node = Node('i-4382922a', None, None, None, None, self.driver) self.driver.ex_delete_tags(node, {'sample': 'tag'}) + + def test_ex_delete_tags2(self): + node = Node('i-4382922a', None, None, None, None, self.driver) + self.driver.ex_create_tags(node, {'sample': 'another tag'}) + self.driver.ex_delete_tags(node, {'sample':None}) def test_ex_describe_addresses_for_node(self): node1 = Node('i-4382922a', None, None, None, None, self.driver)