From: Loic Dachary Date: Wed, 1 Jan 2014 21:11:30 +0000 (+0100) Subject: ceph-disk: create the data directory if it does not exist X-Git-Tag: v0.67.6~1^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c4b66bbdf09a8bb85ed14fbb643f40f87345463b;p=ceph.git ceph-disk: create the data directory if it does not exist 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 (cherry picked from commit 306b099ab093bfac466d68fe1cb87367bc01e577) --- diff --git a/src/ceph-disk b/src/ceph-disk index 9d76a4bdd56f..3f08641a5cd4 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -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