Bug 879299 - rhncfg-client diff tracebacks with UnboundLocalError: local variable 'statinfo' referenced before assignment
Summary: rhncfg-client diff tracebacks with UnboundLocalError: local variable 'statinf...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Client
Version: 550
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Martin Minar
URL:
Whiteboard:
: 878893 (view as bug list)
Depends On:
Blocks: 819027
TreeView+ depends on / blocked
 
Reported: 2012-11-22 14:53 UTC by Jan Hutař
Modified: 2016-07-04 00:57 UTC (History)
4 users (show)

Fixed In Version: rhncfg-5.10.27-11.el5sat
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-07 15:21:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:1552 0 normal SHIPPED_LIVE Red Hat Network Tools rhcfg bug fix update 2012-12-07 20:19:06 UTC

Description Jan Hutař 2012-11-22 14:53:14 UTC
Description of problem:
Diffing deployed config files produces traceback.


Version-Release number of selected component (if applicable):
rhncfg-client-5.10.27-8.el6sat.noarch


How reproducible:
always


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
    handler.run()
  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 16:58:24 UTC
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 17:15:08 UTC
Committed fix to Spacewalk master: 4a4b1b697a21e2ad283f259204f72c3ddbeb60fd

Comment 6 Michael Mráka 2012-12-03 10:43:11 UTC
*** Bug 878893 has been marked as a duplicate of this bug. ***

Comment 9 errata-xmlrpc 2012-12-07 15:21:04 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-2012-1552.html


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