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.77~54^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=306b099ab093bfac466d68fe1cb87367bc01e577;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 --- diff --git a/src/ceph-disk b/src/ceph-disk index f5ba04d8bccf..7ac13e5c37e5 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -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