From d0da33325c6320af791c8d4756615c401c4c4181 Mon Sep 17 00:00:00 2001 From: Angelina Nikiforova Date: Mon, 20 May 2019 14:18:57 +0200 Subject: [PATCH] fixed set and unset tag for ec2 --- wrapanapi/systems/ec2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wrapanapi/systems/ec2.py b/wrapanapi/systems/ec2.py index 9ef76256..59eb4391 100644 --- a/wrapanapi/systems/ec2.py +++ b/wrapanapi/systems/ec2.py @@ -31,7 +31,8 @@ def _regions(regionmodule, regionname): class _TagMixin(object): def set_tag(self, key, value): - self.system.ec2_connection.create_tags(Resources=[self.uuid], Tags={key: value}) + self.system.ec2_connection.create_tags(Resources=[self.uuid], + Tags=[{"Key": key, "Value": value}]) def get_tag_value(self, key): self.refresh() @@ -42,7 +43,8 @@ def get_tag_value(self, key): return None def unset_tag(self, key, value): - self.system.ec2_connection.delete_tags(Resources=[self.uuid], Tags={key: value}) + self.system.ec2_connection.delete_tags(Resources=[self.uuid], + Tags=[{"Key": key, "Value": value}]) class EC2Instance(Instance, _TagMixin):