From: Loic Dachary Date: Tue, 18 Aug 2015 12:43:15 +0000 (+0200) Subject: ceph-disk: only call restorecon when available X-Git-Tag: v9.1.0~357^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5597%2Fhead;p=ceph.git 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 --- diff --git a/src/ceph-disk b/src/ceph-disk index cb19cafc28e3..85196f94c235 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)