Bug 731284

Summary: "Compare all managed files to system" fails on RHEL4
Product: Red Hat Satellite 5 Reporter: David Swegen <dswegen>
Component: ClientAssignee: Michael Mráka <mmraka>
Status: CLOSED ERRATA QA Contact: Dimitar Yordanov <dyordano>
Severity: high Docs Contact:
Priority: high    
Version: 541CC: cperry, dyordano, gasmith, xdmoon
Target Milestone: ---Keywords: Patch, Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rhncfg-5.9.27-18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-16 16:06:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 715348    
Attachments:
Description Flags
Patch to correct the issue none

Description David Swegen 2011-08-17 09:11:47 UTC
Created attachment 518625 [details]
Patch to correct the issue

Description of problem:

5.4.1 seems to have introduced a bug when running the "Compare all managed files to system when run against RHEL4 (4.8 in this instance) clients:


Version-Release number of selected component (if applicable):


How reproducible:

Every time


Steps to Reproduce:

In a system overview click on:

configuration -> overview -> Compare all managed files to system -> schedule compare

A scheduled comparison task will show up:
-----------------------------------------------------

Show differences between profiled config files and deployed config files 	07/26/11 11:28:48 AM CEST. AM CEST 	0 	0 	1 	

-----------------------------------------------------
Then I try to run a rhn_check to force the execution I get the following errors:

[root@acc3001 ~]# rhn_check
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 345, in ?
    handle_action(action)
  File "/usr/sbin/rhn_check", line 218, in handle_action
    (status, message, data) = run_action(method, params)
  File "/usr/sbin/rhn_check", line 174, in run_action
    (status, message, data) = do_call(method, params)
  File "/usr/sbin/rhn_check", line 91, in do_call
    retval = apply(method, params)
  File "/usr/share/rhn/actions/configfiles.py", line 330, in diff
    diff = fp.diff(file)
  File "/usr/share/rhn/config_common/file_utils.py", line 105, in diff
    if not is_selinux_enabled():
NameError: global name 'is_selinux_enabled' is not defined


--------------------------------------
After repeating rhn_check a couple of times the scheduled task fails and you can find it in the failed tasks history.
  

Expected results:

The command should complete as expected, with no traceback


Additional info:

The attached patch corrects the problem.

Comment 1 Tomas Lestach 2011-08-17 13:53:14 UTC
client/tools/rhncfg/config_common/file_utils.py seems like a client issue ... reseting component.

Comment 10 Michael Mráka 2011-08-24 13:57:13 UTC
Backported to SATELLITE-5.4 as
commit 42559f026916ecb52d0073b58c01e311e20c7113
    731284 - is_selinux_enabled is not defined on RHEL4

Comment 13 Dimitar Yordanov 2011-09-15 08:49:32 UTC
Verified RHEL4

Comment 14 errata-xmlrpc 2011-09-16 16:06:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1315.html