Project

General

Profile

Actions

Bug #16849

closed

When 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

Added by Nicolas CHARLES about 4 years ago. Updated almost 4 years ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Reviewed
Fix check:
Checked
Regression:

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


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #16850: package_state_options doesn't properly defines outcome classes when called twice with same package nameReleasedAlexis MoussetActions
Actions

Also available in: Atom PDF