Skip to content

Commit

Permalink
Merge pull request #382 from lina-nikiforova/aws_tag
Browse files Browse the repository at this point in the history
[RFR] fixed set and unset tag for ec2
  • Loading branch information
mshriver authored May 20, 2019
2 parents 88a0047 + d0da333 commit 22f4a0e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wrapanapi/systems/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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):
Expand Down

0 comments on commit 22f4a0e

Please sign in to comment.