From 3aab146bb7aef28c6f0690280b96b434300f6938 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 18 Aug 2015 14:43:15 +0200 Subject: [PATCH] ceph-disk: only call restorecon when available 9db80da12803d42bb676d67f37442c0c54d83448 added an unconditional call to restorecon after mounting the filesystem. It fails when restorecon is not available and must be made conditional. http://tracker.ceph.com/issues/12718 Fixes: #12718 Signed-off-by: Loic Dachary --- src/ceph-disk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ceph-disk b/src/ceph-disk index cb19cafc28e39..85196f94c2359 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -963,12 +963,13 @@ def mount( path, ], ) - command( - [ - 'restorecon', - path, + if which('restorecon'): + command( + [ + 'restorecon', + path, ], - ) + ) except subprocess.CalledProcessError as e: try: os.rmdir(path) -- 2.39.5