From: Owen Synge Date: Tue, 5 Aug 2014 15:28:16 +0000 (+0200) Subject: Do not make directories by mistake. X-Git-Tag: v0.85~95^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b4c80e31e36dc9eee1272619fabd27c042e99df9;p=ceph.git 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 --- diff --git a/src/ceph-disk b/src/ceph-disk index e3c8102b901c..c1d4efb0d61f 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