diff options
author | David Lehman <dlehman@redhat.com> | 2009-12-15 13:01:18 -0600 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-12-15 13:16:46 -0600 |
commit | 08cac34b60320c336a9e8f46ada8d75a65a84e44 (patch) | |
tree | b2680543adabe210911fdb8f02ebfad21c055e61 /isys | |
parent | 87ffa930ad974e0c6e4deda01900702f265f79c9 (diff) | |
download | anaconda-08cac34b60320c336a9e8f46ada8d75a65a84e44.tar.gz anaconda-08cac34b60320c336a9e8f46ada8d75a65a84e44.tar.xz anaconda-08cac34b60320c336a9e8f46ada8d75a65a84e44.zip |
Include error messages when logging selinux context get/set failures.
Diffstat (limited to 'isys')
-rwxr-xr-x | isys/isys.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/isys/isys.py b/isys/isys.py index 9341c6bd4..44f9d3dd9 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -602,8 +602,8 @@ def matchPathContext(fn): con = None try: con = selinux.matchpathcon(os.path.normpath(fn), 0)[1] - except OSError: - log.info("failed to get default SELinux context for %s" % fn) + except OSError as e: + log.info("failed to get default SELinux context for %s: %s" % (fn, e)) return con ## Set the SELinux file context of a file @@ -616,8 +616,8 @@ def setFileContext(fn, con, instroot = '/'): if con is not None and os.access(full_path, os.F_OK): try: rc = (selinux.lsetfilecon(full_path, con) == 0) - except OSError: - log.info("failed to set SELinux context for %s" % full_path) + except OSError as e: + log.info("failed to set SELinux context for %s: %s" % (full_path, e)) return rc ## Restore the SELinux file context of a file to its default. |