Project

General

Profile

Bug #16849

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 7 months ago. Updated 5 months ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
User visibility:
Effort required:
Priority:
0

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

Related to ncf - Bug #16850: package_state_options doesn't properly defines outcome classes when called twice with same package nameReleasedAlexis MOUSSETActions
#1

Updated by Nicolas CHARLES 7 months ago

  • Related to Bug #16850: package_state_options doesn't properly defines outcome classes when called twice with same package name added
#2

Updated by Nicolas CHARLES 7 months ago

  • Status changed from New to In progress
  • Assignee set to Nicolas CHARLES
#3

Updated by Nicolas CHARLES 7 months ago

  • Assignee changed from Nicolas CHARLES to Benoît PECCATTE
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/1586
#4

Updated by Nicolas CHARLES 6 months ago

  • Status changed from In progress to Pending release
#7

Updated by Vincent MEMBRÉ 5 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 5.0.17 and 6.0.5 which were released today.

Also available in: Atom PDF