[Spacewalk-list] 'rhncfg-client verify' traceback

Colin Coe colin.coe at gmail.com
Tue Nov 29 02:32:54 UTC 2011


Hi all

I'm getting a taceback when running rhncfg-client verify on a newly
built RHEL6 node.  I hacked
/usr/share/rhn/config_client/rhncfgcli_verify.py to print the name of
the file it is processing and I find that it is failing on
/etc/auto.master.

rhncfg-client verify
Using server name 172.22.106.16
/etc/auto.home
/etc/auto.hp
/etc/auto.master
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/rhncfgcli_verify.py", line 83, in run
    ret_dict = self._process_file(src, dst, file, ftype, file_info)
  File "/usr/share/rhn/config_client/rhncfgcli_verify.py", line 259,
in _process_file
    dst_selinux = lgetfilecon(dst)[1]
OSError: [Errno 2] No such file or directory

ls -lZ /etc/auto.master
-rw-r--r--. root root system_u:object_r:etc_t:s0       /etc/auto.master

Anyway, this small patch silences the error.  Not sure if this is the
right way to handle it though.

diff -uw /usr/share/rhn/config_client/rhncfgcli_verify.py.orig
/usr/share/rhn/config_client/rhncfgcli_verify.py
--- /usr/share/rhn/config_client/rhncfgcli_verify.py.orig	2011-11-29
10:29:13.194363922 +0800
+++ /usr/share/rhn/config_client/rhncfgcli_verify.py	2011-11-29
10:30:38.706358435 +0800
@@ -248,8 +248,11 @@
             src_selinux = info['selinux_ctx']
             if src_selinux:
                 if not stat_err:
-                    dst_selinux = lgetfilecon(dst)[1]
-                    if dst_selinux == None:
+                    try:
+                        dst_selinux = lgetfilecon(dst)[1]
+                        if dst_selinux == None:
+                            dst_selinux = ""
+                    except:
                         dst_selinux = ""
                 else:
                     dst_selinux = "missing"



Thanks

CC

-- 
RHCE#805007969328369




More information about the Spacewalk-list mailing list