]> 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)
committerAlfredo Deza <alfredo@deza.pe>
Wed, 12 Feb 2014 21:17:12 +0000 (16:17 -0500)
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>
(cherry picked from commit 306b099ab093bfac466d68fe1cb87367bc01e577)

src/ceph-disk

index 9d76a4bdd56f38edd5c491af6ce73a5642d2c190..3f08641a5cd4971469b75fec4aa46b9c38f405ab 100755 (executable)
@@ -1219,7 +1219,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