Bug 879299 - rhncfg-client diff tracebacks with UnboundLocalError: local variable 'statinfo' referenced before assignment
rhncfg-client diff tracebacks with UnboundLocalError: local variable 'statinf...
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Client (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Stephen Herr
Martin Minar
: 878893 (view as bug list)
Depends On:
Blocks: 819027
  Show dependency treegraph
Reported: 2012-11-22 09:53 EST by Jan Hutař
Modified: 2016-07-03 20:57 EDT (History)
4 users (show)

See Also:
Fixed In Version: rhncfg-5.10.27-11.el5sat
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-12-07 10:21:04 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Hutař 2012-11-22 09:53:14 EST
Description of problem:
Diffing deployed config files produces traceback.

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

How reproducible:

Steps to Reproduce:
1. Have config files to diff
2. # rhncfg-client diff

Actual results:
Traceback (most recent call last):
  File "/usr/bin/rhncfg-client", line 34, in <module>
    sys.exit(Main().main() or 0)
  File "/usr/share/rhn/config_common/rhn_main.py", line 195, in main
  File "/usr/share/rhn/config_client/handler_base.py", line 66, in run
    self._process_file(src, dst, file, ftype, file_info)
  File "/usr/share/rhn/config_client/rhncfgcli_diff.py", line 43, in _process_file
    sys.stdout.write(''.join(diff(src, dst, srcname=dst, dstname=dst)))
  File "/usr/share/rhn/config_common/file_utils.py", line 161, in diff
    (dst_content, dst_name, dst_time, dst_stat) = f_content(dst, dstname)
  File "/usr/share/rhn/config_common/file_utils.py", line 158, in f_content
    return (content, name, f_time, statinfo)
UnboundLocalError: local variable 'statinfo' referenced before assignment

Expected results:
This should not traceback
Comment 2 Stephen Herr 2012-11-27 11:58:24 EST
One note, this is not "always" reproducible. It is happens always and only if os.access(path, os.R_OK) returns False for one of the files you are diffing. So this will happen if a file does not exist or if the root user somehow does not have permission to read it. Otherwise, if all files exist and are permissioned normally, the diff will work fine.
Comment 3 Stephen Herr 2012-11-27 12:15:08 EST
Committed fix to Spacewalk master: 4a4b1b697a21e2ad283f259204f72c3ddbeb60fd
Comment 6 Michael Mráka 2012-12-03 05:43:11 EST
*** Bug 878893 has been marked as a duplicate of this bug. ***
Comment 9 errata-xmlrpc 2012-12-07 10:21:04 EST
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.


Note You need to log in before you can comment on or make changes to this bug.