From: Jan Fajerski Date: Fri, 22 Nov 2019 09:46:05 +0000 (+0100) Subject: ceph-volume: don't assume SELinux X-Git-Tag: v15.1.0~797^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31809%2Fhead;p=ceph.git ceph-volume: don't assume SELinux Expect selinux related binaries to not be present. Fixes: 33c8a64a54d9ea8962091caf8564cea3f603c5f5 Fixes: https://tracker.ceph.com/issues/42957 Signed-off-by: Jan Fajerski --- diff --git a/src/ceph-volume/ceph_volume/util/system.py b/src/ceph-volume/ceph_volume/util/system.py index b5c4ce940aed..100bcd7b0d25 100644 --- a/src/ceph-volume/ceph_volume/util/system.py +++ b/src/ceph-volume/ceph_volume/util/system.py @@ -297,7 +297,13 @@ def set_context(path, recursive=False): ) return - stdout, stderr, code = process.call(['selinuxenabled'], verbose_on_failure=False) + try: + stdout, stderr, code = process.call(['selinuxenabled'], + verbose_on_failure=False) + except FileNotFoundError: + logger.info('No SELinux found, skipping call to restorecon') + return + if code != 0: logger.info('SELinux is not enabled, will not call restorecon') return