Ticket #1152: bcfg2-yum-verify-check-configuration.patch

File bcfg2-yum-verify-check-configuration.patch, 2.8 KB (added by https://www.google.com/accounts/o8/id?id=AItOawn0s7RDAZJqmy8qhaS8PFtgoke6VxxZKSI, 8 years ago)

A better patch that covers a more limited set of changes

  • src/lib/Bcfg2/Client/Tools/YUM.py

    From ff15ed156703b0c854d0c3cef32cdcc8a36d80e8 Mon Sep 17 00:00:00 2001
    From: Jonathan Billings <jsbillin@umich.edu>
    Date: Tue, 26 Nov 2013 12:14:31 -0500
    Subject: [PATCH 1/2] YUM: Add a check to ignore verification failures on configuration files
    
    * Many RPM packages have files marked as configuration files
    * When Bcfg2 reinstalls a package that has a file marked as
      config(noreplace), it doesn't replace the file anyway.
    * This change ignores any verification file that is marked as a
      configuration file.
    * It doesn't distinguish the noreplace and replace kinds of files.
    ---
     src/lib/Bcfg2/Client/Tools/YUM.py |    4 ++++
     1 files changed, 4 insertions(+), 0 deletions(-)
    
    diff --git a/src/lib/Bcfg2/Client/Tools/YUM.py b/src/lib/Bcfg2/Client/Tools/YUM.py
    index c30c0a1..ea805fa 100644
    a b class YUM(Bcfg2.Client.Tools.PkgTool): 
    663663                        continue 
    664664                    elif 'no' + prob.type in verify_flags: 
    665665                        continue 
     666                    if 'configuration' in prob.file_types: 
     667                        self.logger.debug( 
     668                            "  %s is a configuration file, skipping" % fname) 
     669                        continue 
    666670                    if prob.type not in ['missingok', 'ghost']: 
    667671                        tmp.append((prob.type, prob.message)) 
    668672                if tmp != []: 
  • src/lib/Bcfg2/Client/Tools/YUM.py

    -- 
    1.7.1
    
    
    From 0f240868e39c21be2a3b7b2c3e8c4f76e86cb015 Mon Sep 17 00:00:00 2001
    From: Jonathan Billings <jsbillin@umich.edu>
    Date: Tue, 26 Nov 2013 16:24:22 -0500
    Subject: [PATCH 2/2] YUM: update package verification config file check
    
    Make sure that only a checksum, size, mode, user, group or mtime
    verification failure is the reason why a package reinstall is skipped
    when the file is a configuration file.
    ---
     src/lib/Bcfg2/Client/Tools/YUM.py |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/lib/Bcfg2/Client/Tools/YUM.py b/src/lib/Bcfg2/Client/Tools/YUM.py
    index ea805fa..a6df11a 100644
    a b class YUM(Bcfg2.Client.Tools.PkgTool): 
    663663                        continue 
    664664                    elif 'no' + prob.type in verify_flags: 
    665665                        continue 
    666                     if 'configuration' in prob.file_types: 
     666                    if prob.type in ['checksum','size','mode', 'user','group','mtime'] and 'configuration' in prob.file_types: 
    667667                        self.logger.debug( 
    668                             "  %s is a configuration file, skipping" % fname) 
     668                            "  %s is a configuration file, skipping (%s)" % (fname,prob.type)) 
    669669                        continue 
    670670                    if prob.type not in ['missingok', 'ghost']: 
    671671                        tmp.append((prob.type, prob.message))