From 306b099ab093bfac466d68fe1cb87367bc01e577 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Wed, 1 Jan 2014 22:11:30 +0100 Subject: [PATCH] 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 --- src/ceph-disk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ceph-disk b/src/ceph-disk index f5ba04d8bccf4..7ac13e5c37e53 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 -- 2.39.5