]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: only call restorecon when available 5597/head
authorLoic Dachary <ldachary@redhat.com>
Tue, 18 Aug 2015 12:43:15 +0000 (14:43 +0200)
committerLoic Dachary <ldachary@redhat.com>
Tue, 18 Aug 2015 12:43:15 +0000 (14:43 +0200)
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 <ldachary@redhat.com>
src/ceph-disk

index cb19cafc28e393933d1b618e4a5ad62ab4852190..85196f94c2359768d51ec59fbdbf3ce654ba80f2 100755 (executable)
@@ -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)