Bug #16849
closedWhen using twice directive packageManagement 1.2, once to ensure presence of a package, and second one to upgrade the package, reporting and posthook is wrong on the second one
Description
I we use packageManagement 1.2 to ensure sudo is there, and to upgrade it, first call defines
package_present_sudo_kept
package_present_sudo_reached
and second one don't redefines the repair class when upgrading
However, using the class_prefix of package_state_options solves the issue, as we get package_state_options_sudo_1_8_23_4_el7_7_2_default_default_present__repaired
So we ought to define inner class prefix "inner_class_prefix" string => canonify("package_state_options_${package[${index_pkg}]}_${version[${index_pkg}]}_${architecture[${index_pkg}]}_${manager[${index_pkg}]}_${state[${index_pkg}]}_${manager_final_options[${index_pkg}]}"); (truncating it at 1000 char to do like in the generic method), and use it for reporting and posthook
Also, we reporting that the posthook is NA if we don't hae the reached for the posthook, but in case of issues with command (or reporting), we should check if posthook was defined, and yet not run, and report an error