-
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
Fix notifying handlers by using an exact match #55624
Conversation
…ubset if listen is text rather than a list
Get validated value early enough
Can this be merged? I think this is a serious bug in ansible 2.8 |
I talked to @bcoca a little more about this one and have come to the conclusion that there is parity with the templating behavior on devel and previous versions of Ansible. I added tests to make sure that remains the same and a couple notes to the documentation to clarify. |
@@ -367,14 +367,17 @@ def get_original_host(host_name): | |||
else: | |||
return self._inventory.get_host(host_name) | |||
|
|||
def get_handler_templar(handler_task): |
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.
Does this need to be a local function? Several of the others are, because they are using context from _process_pending_results
. I don't think this one needs to though, it would just require passing in iterator
also.
Not a blocker, just a potential improvement.
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 the suggestion, fixed that.
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.
docs portion LGTM
* Fix notifying handlers by using an exact match rather than a string subset if listen is text rather than a list * Enforce better type checking for listeners * Share code for validating handler listeners * Add test for handlers without names * Add test for templating in handlers * Add test for include_role * Add a couple notes about 'listen' for handlers * changelog (cherry picked from commit ec1287c)
* Fix notifying handlers by using an exact match rather than a string subset if listen is text rather than a list * Enforce better type checking for listeners * Share code for validating handler listeners * Add test for handlers without names * Add test for templating in handlers * Add test for include_role * Add a couple notes about 'listen' for handlers * changelog (cherry picked from commit ec1287c)
* Fix notifying handlers by using an exact match rather than a string subset if listen is text rather than a list * Enforce better type checking for listeners * Share code for validating handler listeners * Add test for handlers without names * Add test for templating in handlers * Add test for include_role * Add a couple notes about 'listen' for handlers * changelog * Add a test for handlers without names * Test templating in handlers * changelog * Add some tests for include_role * Add a couple notes about 'listen' for handlers * make more sense * move local function into a class method
SUMMARY
Fixes #55575
Introduced in 2a469fd.
'string' in 'stringwithmore' is True, so make sure to wrap listeners in a list to get only exact matches: 'string' in ['stringwithmore'] is False.
ISSUE TYPE