-
Notifications
You must be signed in to change notification settings - Fork 664
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 false positive reports in is_handler function #4170
Conversation
Found in the process of writing and checking custom rules. The "is_handler" function considers all tasks from the file to be handlers if the file name contains the substring "handlers". Therefore, all tasks in the check_handlers_playbook.yaml playbook were accepted as handlers. I'm not sure if it's worth relying on the filename or path at all. But if we do, then maybe it makes sense to look for the full string, not just a part of it.
Actually there is one more issue with detecting handlers. It is triggers in role handlers and not in plain playbook This task will be detected as handler
because it's object has attribute
This task won't be detected as handler
because it's object hasn't attribute
Both "self.position" don't have "handlers" word in it. This function probably requires some redesign. Unfortunally python is not my lang, so I'm not gonna dig it dipper by myself. env:
|
Found in the process of writing and checking custom rules.
The "is_handler" function considers all tasks from the file to be handlers if the file name contains the substring "handlers".
Therefore, all tasks in the check_handlers_playbook.yaml playbook were accepted as handlers.
I'm not sure if it's worth relying on the filename or path at all. But if we do, then maybe it makes sense to look for the full string, not just a part of it.