You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
Currently it's confusing and hard to maintain for module developers, how to set exit_x and log_x_risk functions in a module and what would be the outcome, because each combination of them yields different results.
Change API for modules as follows:
log_x_risk will be replaced with set_result (the name can be decided later).
By calling set_result the module developer will specify, what result of the module they want in the report (pass, fixed, fail, needs_inspection, needs_action, informational, not_applicable).
The set_result could be called multiple times within a module.
The module will have to eventually call the exit_module function, that will collect the information from the called set_result and will pick the "most important" result.
Well, what I had in mind was rather that module would only have to call log_x_risk and the actual result would be inferred from that. IOW, the API should not rely on a state held in the module process. This is also why I don't think exit_module as presented here is good enough; this still depends on module not crashing and burning in a fireball.
If you want to see record of "my idea", I have already documented in https://bugzilla.redhat.com/show_bug.cgi?id=1400672; the wrapper actually implements exactly the kind of logic I think should be the "end-game".
(That said, the proposal is a bit better than status quo, OTOH bar is low on that one ;-))
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently it's confusing and hard to maintain for module developers, how to set
exit_x
andlog_x_risk
functions in a module and what would be the outcome, because each combination of them yields different results.Change API for modules as follows:
log_x_risk
will be replaced withset_result
(the name can be decided later).set_result
the module developer will specify, what result of the module they want in the report (pass, fixed, fail, needs_inspection, needs_action, informational, not_applicable).set_result
could be called multiple times within a module.exit_module
function, that will collect the information from the calledset_result
and will pick the "most important" result.exit_module
will set a risk* if needed, according to https://github.com/upgrades-migrations/preupgrade-assistant/wiki/How-modules-affect-the-Preupgrade-Assistant-return-code, and stop execution of the module with one of the exit codes expected by OpenSCAP.*The question is, what risk should the
exit_module
set if the module developer wants to have needs_inspection result - slight or medium risk?This is a record of ideas of @AloisMahdal and @pirat89. Is it +- as you wanted?
The text was updated successfully, but these errors were encountered: