Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method TaggedEC2Object.add_tags(). #2259

Merged
merged 3 commits into from Jun 6, 2014

Conversation

rohitagarwal003
Copy link
Contributor

There is already a TaggedEC2Object.add_tag() method but it only supports
adding one tag at a time. The CreateTags api supports adding multiple tags
at once. So, when you want to add multiple tags you needlessly make multiple
round-trips to EC2 service. The add_tags() method helps in avoiding that.

There is already a TaggedEC2Object.add_tag() method but it only supports
adding one tag at a time. The CreateTags api supports adding multiple tags
at once. So, when you want to add multiple tags you needlessly make multiple
round-trips to EC2 service. The add_tags method helps in avoiding that.
@toastdriven
Copy link
Contributor

This looks good. Would it be possible to get some unit tests on this? Unfortunately, there are no existing tests (tests/unit/ec2/test_ec2object.py would be the spot), but something akin to https://github.com/boto/boto/blob/develop/tests/unit/ec2/test_instance.py#L210-L243 (plus adding a sample response, from the AWS docs is fine) would be perfect & would make this mergeable.

@toastdriven toastdriven self-assigned this May 30, 2014
The documentation says that there is a distinction between a
value of '' and a value of None. The API docs say the same
thing. But the code was not following the docs:
    if value:
returns False for both None and ''.
@rohitagarwal003
Copy link
Contributor Author

I have added unit tests for all methods in ec2object.py.
Note that I have also modified the remove_tag method to follow the documented behaviour accurately.

@danielgtaylor
Copy link
Member

Thanks for adding the tests. 👍

danielgtaylor added a commit that referenced this pull request Jun 6, 2014
Add method TaggedEC2Object.add_tags(). Fixes #2259.
@danielgtaylor danielgtaylor merged commit eea5467 into boto:develop Jun 6, 2014
@toastdriven toastdriven removed their assignment Mar 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants