Bug 743424 - "rhncfg-client diff" fails on missing symlink
Summary: "rhncfg-client diff" fails on missing symlink
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 1.5
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16
TreeView+ depends on / blocked
 
Reported: 2011-10-04 21:09 UTC by Brian
Modified: 2011-12-22 16:46 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-12-22 16:46:49 UTC
Embargoed:


Attachments (Terms of Use)

Description Brian 2011-10-04 21:09:47 UTC
Description of problem:
rhncfg-client crashes out if the Config channel has a symlink that does not exist on the client, or it isn't a symlink.

Version-Release number of selected component (if applicable):
Spacewalk Client 1.5 on RHEL6

How reproducible:

Steps to Reproduce:
1. Add a symlink to a client's config channel
2. Make sure that path does not exist on the client
3. Run 'rhncfg-client diff' on the client
  
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 184, 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 31, in _process_file
    destlink = os.readlink(dst)
OSError: [Errno 2] No such file or directory: '/etc/nss_ldap.conf'

*** or if it exists but isn't a symlink ***
OSError: [Errno 22] Invalid argument: '/etc/nss_ldap.conf'

Expected results:
rhncfg-client should report the file as "missing" or "not a symlink" as needed.

Additional info:

Comment 1 Milan Zázrivec 2011-10-07 14:57:23 UTC
Thank you for the bug report, problem fixed in:

spacewalk.git master: 57cd8d0a5150bf37ca613f0df2da0c3ec2056919

Comment 2 Brian 2011-10-14 15:08:24 UTC
That fixes when it's missing, but it also might not be a symlink even when it exists:

Traceback (most recent call last):
  File "/usr/bin/rhncfg-client", line 34, in ?
    sys.exit(Main().main() or 0)
  File "/usr/share/rhn/config_common/rhn_main.py", line 184, 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 35, in _process_file
    destlink = os.readlink(dst)
OSError: [Errno 22] Invalid argument: '/etc/snmp/snmpd.options'

Comment 3 Milan Zázrivec 2011-10-19 10:28:45 UTC
Thank you for the feedback, problem fixed in spacewalk.git master in commit:
d58d87aa29cabe68983dfa02aa85dbba1e747d2c

Comment 4 Milan Zázrivec 2011-12-22 16:46:49 UTC
Spacewalk 1.6 has been released.


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