Red Hat Bugzilla – Bug 879299
rhncfg-client diff tracebacks with UnboundLocalError: local variable 'statinfo' referenced before assignment
Last modified: 2016-07-03 20:57:28 EDT
Description of problem:
Diffing deployed config files produces traceback.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Have config files to diff
2. # rhncfg-client diff
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
This should not traceback
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.
Committed fix to Spacewalk master: 4a4b1b697a21e2ad283f259204f72c3ddbeb60fd
*** Bug 878893 has been marked as a duplicate of this bug. ***
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.