-
Notifications
You must be signed in to change notification settings - Fork 398
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
Fix parameter validation in ecs_task #402
Fix parameter validation in ecs_task #402
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR.
I think it would be good to add a couple of entries to the operation description (line 21)
- When I(operation=start) both I(task_definition) and I(container_instances) must be set.
- When I(operation=stop) both I(task_definition) and I(task) must be set.
Integration tests would also be a nice-to-have, but since they seem to be completely missing right now it's totally reasonable for you not to add them.
0fbf051
to
8f3f5c6
Compare
8f3f5c6
to
ed89482
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a future thing, I find using a temporary variable (same as we do with argument_spec) preferable to the way you split required_if to stay within 80 chars. In this case it would have allowed you to group things a little more clearly. But that's a personal style thing.
Thanks for fixing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for taking the time to submit this PR. The fix should be available in version 1.4.0 which we expect to release in the near future. |
* Fix parameter validation in ecs_task * Require cluster parameter in ecs_task module * Move parameter validation to AnsibleAWSModule * Fix pep8 formatting line too long * changelog
* Fix parameter validation in ecs_task * Require cluster parameter in ecs_task module * Move parameter validation to AnsibleAWSModule * Fix pep8 formatting line too long * changelog
* Fix parameter validation in ecs_task * Require cluster parameter in ecs_task module * Move parameter validation to AnsibleAWSModule * Fix pep8 formatting line too long * changelog
* Fix parameter validation in ecs_task * Require cluster parameter in ecs_task module * Move parameter validation to AnsibleAWSModule * Fix pep8 formatting line too long * changelog
SUMMARY
Fixes incorrect logic in parameter validation.
This will not evaluate to true even if
task_definition
not provided becausemodule.params['task_definiton'] = None
by default. Which means the condition 'task_definition' not in module.params is always false.Fixes #401
ISSUE TYPE
COMPONENT NAME
ecs_task