-
Notifications
You must be signed in to change notification settings - Fork 341
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
Logic for nested HttpRequestMethodConfig Values #188
Conversation
I've found that the issue I was experiencing with HttpRequestMethodConfig applies to all other field categories with the exception of SourceIpConfig. SourceIpConfig already had a similar condition to the ones I have added for other fields. Updated the linked issue with additional detail and updated this PR to resolve issue for all possible condition field options. I believe this PR also fixes ansible-collections/community.aws#117 |
Found that while adding support for using HostHeaderConfig or PathPatternConfig I'd inadvertantly impacted cases when Values was defined directly instead. This is specific to the Boto3 behaviour where Conditions['Values'] (Docs) is defined as "The condition value. Specify only when Field is host-header or path-pattern . Alternatively, to specify multiple host names or multiple path patterns, use HostHeaderConfig or PathPatternConfig ." For example when _compare_condition is running against an ALB with an existing host-header field, the current_condition object is represented as:
As a result, my original update was then always trying to compare HostHeaderConfig['Values'], however it is expected that in ansible you can use either Values or HostHeaderConfig. While I've used host-header (HostHeaderConfig) primarily in the above example - the same applies to path-pattern (PathPatternConfig). To cater for both possible methods of configuration, I've updated the conditions to only use HostHeaderConfig or PathPatternConfig for comparison if both current_condition and condition contain the Config dict, otherwise fallback to the pre-existing Values compare. |
Hi @bradleypettit, The patch indeed seems to fix ansible-collections/community.aws#117 too. I need more time to review it completely. |
This should initially fail and be fixed the day ansible-collections/amazon.aws#188 is merged. See: ansible-collections/amazon.aws#187 See: ansible-collections#117
I would like to land ansible-collections/community.aws#347 with this PR, there is a couple of CI-related issues to address first. |
This should initially fail and be fixed the day ansible-collections/amazon.aws#188 is merged. See: ansible-collections/amazon.aws#187 See: ansible-collections#117
This feature depends on boto3 June 13, 2019:
See: https://forums.aws.amazon.com/thread.jspa?messageID=897663 |
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
…ollections#188) * Migrate from boto3_conn to module.client * Simplify error handling when creating connections * Simplify Region handling * Remove unused imports * Changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@6bdf00d
SUMMARY
Fixes #187. Adds logic to the compare_condition function to suit when the 'Values' key is nested within 'HttpRequestMethodConfig'. Otherwise trying to access 'Values' directly throws "KeyError: 'Values'".
ISSUE TYPE
COMPONENT NAME
elbv2.py
ADDITIONAL INFORMATION
As per Boto docs, when condition Field is equal to 'http-request-method', the 'Values' list should then be nested within 'HttpRequestMethodConfig' dict.