]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: create the data directory if it does not exist
authorLoic Dachary <loic@dachary.org>
Wed, 1 Jan 2014 21:11:30 +0000 (22:11 +0100)
committerLoic Dachary <loic@dachary.org>
Fri, 3 Jan 2014 15:30:41 +0000 (16:30 +0100)
Instead of failing if the OSD data directory does not exist, create
it. Only do so if the data directory is not enforced to be a device via
the use of the --data-dev flag. The directory is not recursively created.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/ceph-disk

index f5ba04d8bccf4eb65e158d5f87ca1eba6079b4cf..7ac13e5c37e53b3d72847dc631f91983f9fd4f5c 100755 (executable)
@@ -1216,7 +1216,10 @@ def main_prepare(args):
     try:
         prepare_lock.acquire()
         if not os.path.exists(args.data):
-            raise Error('data path does not exist', args.data)
+            if args.data_dev:
+                raise Error('data path does not exist', args.data)
+            else:
+                os.mkdir(args.data)
 
         # in use?
         dmode = os.stat(args.data).st_mode