Project

General

Profile

Bug #10838

Updated by Janos Mattyasovszky almost 7 years ago

When you have one instance of "File content (key/value)" applied to the same file, it reports "repaired" for all managed keys, "repaired", even if only one promise was changed. repaired. 

 Test: 
 Ensure @k1=v1@, @k2=v2@ and @k3=v3@ are present in @/tmp/testfile@: 

 <pre> 
 # rudder agent run -u -q 
 Rudder agent 4.1.3.release (CFEngine Core 3.10.0) 
 Node uuid: 22627a92-f07e-4f8d-8bc2-6e0d2f19b669 
 ok: Rudder agent promises were updated. 
 Start execution with config [20170602-085821-bc9417f8] 

 M| State           Technique                   Component                   Key                  Message 
 E| repaired        Common                      Update                                         Policy, tools or configuration library were updated or agent service restarted 
 E| repaired        Manage keys-values file     File                        /tmp/testfile        The key -> value k3 = v3 was repaired 
 E| repaired        Manage keys-values file     File                        /tmp/testfile        The key -> value k1 = v1 was repaired 
 E| repaired        Manage keys-values file     File                        /tmp/testfile        The key -> value k2 = v2 was repaired 
 [...] 

 # cat /tmp/testfile 
 k3=v3 
 k1=v1 
 k2=v2 
 </pre> 

 Then add a fourth key=value pair, and update+run: 

 <pre> 
 # rudder agent run -u -q 
 Rudder agent 4.1.3.release (CFEngine Core 3.10.0) 
 Node uuid: 22627a92-f07e-4f8d-8bc2-6e0d2f19b669 
 ok: Rudder agent promises were updated. 
 Start execution with config [20170602-090359-93d09b1e] 

 M| State           Technique                   Component                   Key                  Message 
 E| repaired        Common                      Update                                         Policy, tools or configuration library were updated or agent service restarted 
 E| repaired        Manage keys-values file     File                        /tmp/testfile        The key -> value k3 = v3 was repaired 
 E| repaired        Manage keys-values file     File                        /tmp/testfile        The key -> value k4 = v4 was repaired 
 E| repaired        Manage keys-values file     File                        /tmp/testfile        The key -> value k1 = v1 was repaired 
 E| repaired        Manage keys-values file     File                        /tmp/testfile        The key -> value k2 = v2 was repaired 

 ## Summary ##################################################################### 
 39 components verified in 7 directives 
    => 39 components in Enforce mode 
       -> 31 compliant 
       -> 5 repaired 
       -> 3 not-applicable 
 execution time: 1.87s 
 ################################################################################ 

 # cat /tmp/testfile 
 k3=v3 
 k1=v1 
 k2=v2 
 k4=v4 
 </pre> 

 Expected is only a repaired message about @k4=v4@, but instead one gets messages for all promised key=value pairs. 

Back