diff options
author | Ryan Harper <ryan.harper@canonical.com> | 2017-04-27 20:34:28 +0000 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-06-12 12:46:14 -0400 |
commit | 95fd5a2b5426f3420e05ac190eb9f286df630484 (patch) | |
tree | c9529e7f90249c22fde9fbcd4dadb1e075e36e42 /cloudinit | |
parent | a01ffd65492e2882408aa18972ff80021eee624a (diff) | |
download | vyos-cloud-init-95fd5a2b5426f3420e05ac190eb9f286df630484.tar.gz vyos-cloud-init-95fd5a2b5426f3420e05ac190eb9f286df630484.zip |
selinux: Allow restorecon to be non-fatal.
On some systems with python-libselinux a bug[1] related to recursive
restorecon fails but the distro release does not yet include
an update. This change will accept the error and log a warning.
1. https://bugzilla.redhat.com/show_bug.cgi?id=1406520
LP: #1686751
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/util.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index b8c3e4ee..415ca374 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -330,7 +330,11 @@ class SeLinuxGuard(object): LOG.debug("Restoring selinux mode for %s (recursive=%s)", path, self.recursive) - self.selinux.restorecon(path, recursive=self.recursive) + try: + self.selinux.restorecon(path, recursive=self.recursive) + except OSError as e: + LOG.warning('restorecon failed on %s,%s maybe badness? %s', + path, self.recursive, e) class MountFailedError(Exception): |