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 #1

Updated by Nicolas CHARLES about 4 years ago

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

Updated by Nicolas CHARLES about 4 years ago

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

Updated by Nicolas CHARLES about 4 years ago

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

Updated by Nicolas CHARLES about 4 years ago

  • Status changed from In progress to Pending release
Actions #5

Updated by Nicolas CHARLES about 4 years ago

  • Fix check changed from To do to Checked
Actions #6

Updated by Alexis Mousset almost 4 years ago

  • Name check changed from To do to Reviewed
Actions #7

Updated by Vincent MEMBRÉ almost 4 years 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.

Actions

Also available in: Atom PDF