]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: don't assume SELinux 32866/head
authorJan Fajerski <jfajerski@suse.com>
Fri, 22 Nov 2019 09:46:05 +0000 (10:46 +0100)
committerShyukri Shyukriev <shshyukriev@suse.com>
Sat, 25 Jan 2020 20:50:42 +0000 (22:50 +0200)
Expect selinux related binaries to not be present.

Fixes: 33c8a64a54d9ea8962091caf8564cea3f603c5f5
Fixes: https://tracker.ceph.com/issues/42957
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit 72b79f71fa84fe0d56b2fd1745f5bb130380cc38)

src/ceph-volume/ceph_volume/util/system.py

index b5c4ce940aed2691daf48d316810a6e50ccbeb2b..100bcd7b0d25d47ba587e9434df1e32f588bb3e2 100644 (file)
@@ -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