From b4c80e31e36dc9eee1272619fabd27c042e99df9 Mon Sep 17 00:00:00 2001 From: Owen Synge Date: Tue, 5 Aug 2014 17:28:16 +0200 Subject: [PATCH] Do not make directories by mistake. Rational: I found I had created a series of OSD directories under "/dev/" when disks I thought existed did not exist. Warning: This change will be noticed by end users and may effect deployment infrastructures. Signed-off-by: Owen Synge --- src/ceph-disk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ceph-disk b/src/ceph-disk index e3c8102b901c4..c1d4efb0d61f0 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1333,9 +1333,10 @@ def main_prepare(args): prepare_lock.acquire() if not os.path.exists(args.data): if args.data_dev: - raise Error('data path does not exist', args.data) - else: - os.mkdir(args.data) + raise Error('data path for device does not exist', args.data) + if args.data_dir: + raise Error('data path for directory does not exist', args.data) + raise Error('data path does not exist', args.data) # in use? dmode = os.stat(args.data).st_mode -- 2.39.5