Closed GoogleCodeExporter closed 9 years ago
I can't reproduce this issue. Please see log below:
>>> import boto
>>> c = boto.connect_ec2()
>>> c.get_all_instances(filters={'instance-state-name':'running'})
[Reservation:r-1c396c74, Reservation:r-76a71a1b]
>>> i = _[0].instances[0]
>>> i
Instance:i-67c81e0c
>>> c.get_all_tags(filters={'resource-id':i.id})
[]
>>> c.create_tags([i.id], {'foo':'bar'})
True
>>> c.get_all_tags(filters={'resource-id':i.id})
[Tag:foo]
>>> c.delete_tags([i.id], {'foo':'bar'})
True
>>> c.get_all_tags(filters={'resource-id':i.id})
[]
>>>
Can you provide more information on what you are doing?
Original comment by Mitch.Ga...@gmail.com
on 19 Jul 2011 at 2:07
Original comment by Mitch.Ga...@gmail.com
on 19 Jul 2011 at 2:10
Hi Mitch,
I've just realized that this issue is dependent on the version of python i'm
running!
On my amazon ec2 instances I'm using:
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
On my box I'm using:
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2] on linux2
The delete tags call doesn't work on my local box, but works fine on amazon.
I've also noticed that the delete tags call is working fine on my OSX box at
home, running python 2.6
I originally thought it might be an issue with the version of boto, but I've
now tested with them both running boto2.0b4 and the issue only persists on the
box running python 2.7
FYI the result from amazon (I've inspected the XML return value) comes back
fine.
Original comment by jmal...@gmail.com
on 21 Jul 2011 at 9:12
Disregard my previous theories..
I've found the bug and submitted a pull request at github.
https://github.com/boto/boto/pull/289
The problem was deletion of tags where no value is specified.
In build_tag_param_list you were sending a Tag.n.Value of "" if the value was
None.
The boto API states that this will only delete a tag if the value of the tag is
"".
What you want to do instead is to simply not send a Tag.n.Value, then you get
the expected behavior.
Original comment by jmal...@gmail.com
on 3 Aug 2011 at 4:18
This fix was merged to github master in:
https://github.com/boto/boto/commit/fb61bcef465a8b0cea87a52f7051e3dec6752230
Original comment by Mitch.Ga...@gmail.com
on 4 Aug 2011 at 10:05
Original issue reported on code.google.com by
jmal...@gmail.com
on 18 Jul 2011 at 6:56