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 <loic@dachary.org>
(cherry picked from commit
306b099ab093bfac466d68fe1cb87367bc01e577)
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