ceph-disk: only call restorecon when available

9db80da128 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 <ldachary@redhat.com>
This commit is contained in:
Loic Dachary 2015-08-18 14:43:15 +02:00
parent c3de0affcb
commit 3aab146bb7

View File

@ -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)