-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Invert condition when validating function name #38533
Invert condition when validating function name #38533
Conversation
The `.startswith('arn:')` condition for function name validation was reversed, so if the string started `arn:` the check was for a standard function name i.e. does not contain ':'.
cc @mikedlr @pjodouin @willthames |
!component lib/ansible/modules/cloud/amazon/lambda_policy.py -label needs_triage |
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.
I ran into this as well and instead of doing the not, reversed the logic inside the if so the positive is first. Either way works, not sure what is preferable.
Yep, although this is the simplest diff, @JRODJ's solution is preferable as it's more readable. I have a fix in for that and will update the tests to actually check that they work with a function_arn. |
This has been solved via #38863 |
SUMMARY
In
validate_params
the.startswith('arn:')
condition for function name validation was reversed, so if the string startedarn:
the check was for a standard function name i.e. does not contain ':'.ISSUE TYPE
COMPONENT NAME
lambda_policy
ANSIBLE VERSION
ADDITIONAL INFORMATION
When using the lambda_policy module it was not possible to use an arn for the function_name parameter as the validation checked that strings starting
arn:
do not contain:
.