-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add an option to search by specific failure severity #56
Conversation
LGTM. One comment is that I'd feel better if we had a test for each CLI knob ( #57 ). |
So after thinking about it, I'm not so sure filtering WARNINGs from --failures-only is fine. Consider the following WARNING:
Since it's a warning:
But (obviously) this leads into pki-tomcatd not starting after "ipactl restart":
This is because core/files.py uses "if mode != fmode:" and should use a more precise mode comparison: if fmode is more permissive that fmode, yield WARNING, elif fmode is less permissive than fmode, yield ERROR. Obviously restarting ipa leads to a non-functional pki-tomcatd and then ipa-healthcheck catches some errors, but I would argue this is too late. A related logic applies to IPACertmongerExpirationCheck where WARNING is used to catch expiring certificates. An admin using --failures-only would not catch the obvious action item unless it's too late, incurring downtime. However the --severity filter is useful and nice. Can you split this PR in two? |
Converted this PR into only adding the ability to query based on severity level. We can tackle how to handle warnings in the future. My concern was with out to deal with false positives. |
hi @rcritten LGTM. I'm wondering whether we should change the logic - see comment above. But that's not mandatory. |
It is a multi-valued option so can be provided on the command-line multiple times to look for any range of severity levels. This will let one search for only WARNING, for example, or for ERROR and CRITICAL.
Made --severity multi-valued so one can search on ERROR and CRITICAL, for example. |
Code LGTM, man page matches actual behavior. ACK. |
A WARNING is not a failure. Drop it from --failures only.
Add an option to search by specific failure severity.