-
Notifications
You must be signed in to change notification settings - Fork 416
Make WARNING the default verbosity level #630
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
Make WARNING the default verbosity level #630
Conversation
|
(The Jenkins failure is expected) |
|
I think that UNKNOWN level doesn't have any meaning, probably it is just a fallback value for oscap_string_to_enum. However, now, in OpenSCAP you must directly specify verbosity level. The '--verbose' has a required argument. If you omit the level, you will get an error: What's the reason behind this pull request? Do you want to reuse the function somewhere else? Or did you want to make the code more readable? |
|
I want to make "warnings and up" visible by default, even without |
|
@mpreisler OK, That makes sense. Great idea! I think we can ignore the UNKNOWN value and default to WARNING. |
|
@dahaic How do you feel about changing this in a maintenance branch? |
|
Personally, I see it as a bugfix, because proposed behaviour is something I would expect from any utility. So I have no issues with inclusion into the maintenance branch. |
|
Ok, so we have a consensus here. I will change the tests accordingly and finish this up. |
|
@mpreisler The Jenkins fail here looks legit, there are multiple failing test cases in XCCDF directory. |
Yeah, it's expected. Check out comment #630 (comment) I need to change the tests one by one. |
|
TODO:
|
d2743b6 to
810b52a
Compare
It's not a serious warning and in many use-cases is expected.
8365ac2 to
789486e
Compare
If SCE is not installed it will fail in an expected way and it makes no sense to clutter the error log with it. Explicit plugin loading via the API will still fail with errors.
This looks like a serious bug found by this change, the instance is there, it's just that the code fails to find it. I will investigate further after I fix up the rest. rule results XCCDF: |
|
Does anybody understand the code at https://github.com/OpenSCAP/openscap/blob/maint-1.2/src/XCCDF_POLICY/xccdf_policy_substitute.c#L168 ? I think it might be mistaking fix/instance with rule-result/instance but I don't know enough about this part of OpenSCAP to know for sure. |
|
The only instance I can recall in the specs is the one related to textfilecontent result and according to the code, that's the correct relation: I don't know the relation between those instances and this text substitution though, sorry 😞 |
|
I took another look and the instance it's looking for is really not in the rule-results. So it could be that the code is fine. I am leaning towards backlisting this warning in the test. So we will keep warning about this situation but the tests will pass when this warning is in that particular test. I will make the commit shortly. |
|
@openscap-jenkins test this please |
|
@openscap-jenkins test this please |
This has passed before AFAIK. |
Yes I know, I was testing Jenkins, it's only failing on SSG PR's 😞 |
| $OSCAP oval eval --results $result --variables $srcdir/external_variables.xml $srcdir/$name.oval.xml 2> $stderr | ||
| [ ! -s $stderr ] && rm $stderr | ||
| # filter out the expected warnings in stderr | ||
| sed -i -E "/^W: oscap: Referenced variable has no values \(oval:x:var:[13689]\)/d" "$stderr" |
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.
What if the indentation level will change in future? I would put here instead of 6 spaces a regular expression matching at least one space.
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.
Fixed
|
@mpreisler Great job! Thank you. |
DO NOT MERGE, up for discussion.@jan-cerny I have noticed that your oscap_set_verbose code defaults to unknown verbosity and no output. Do you recall what was the reasoning behind that? I expected WARNING level by default and stderr output, which is what this PR does.
Does the UNKNOWN verbose level have any meaning? It seems it's just used to flag that
oscap_set_verbosewas never run with non-NULL verbosity level.Perhaps I am missing something.