]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume util.arg_validators require superuser privs to check paths
authorAlfredo Deza <adeza@redhat.com>
Wed, 8 Nov 2017 14:10:47 +0000 (09:10 -0500)
committerAlfredo Deza <adeza@redhat.com>
Thu, 9 Nov 2017 11:47:43 +0000 (06:47 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/util/arg_validators.py

index 6a2ff956e8586bee32a890d77fc372090b28733a..05438092ca8eeff07a4b6752828f65bd4dd67d9b 100644 (file)
@@ -1,6 +1,7 @@
 import argparse
 import os
-from ceph_volume import terminal
+from ceph_volume import terminal, exceptions
+from ceph_volume import decorators
 from ceph_volume.util import disk
 
 
@@ -45,6 +46,7 @@ class OSDPath(object):
     Validate path exists and it looks like an OSD directory.
     """
 
+    @decorators.needs_root
     def __call__(self, string):
         if not os.path.exists(string):
             error = "Path does not exist: %s" % string