From 6d21a5d0fd84401312fee4a7b66af53846ee7b2f Mon Sep 17 00:00:00 2001 From: dongdong tao Date: Mon, 26 Aug 2019 16:51:58 +0800 Subject: [PATCH] Add protection for dir based osd, to avoid it being re-initialized Change-Id: Id1f3a78bb3108a77f7e2e1d1866657d50ee9dff1 Closes-Bug: #1841021 --- ceph/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ceph/utils.py b/ceph/utils.py index c8a1cdf..8fa076a 100644 --- a/ceph/utils.py +++ b/ceph/utils.py @@ -1944,9 +1944,10 @@ def osdize_dir(path, encrypt=False, bluestore=False): ' skipping'.format(path)) return - if os.path.exists(os.path.join(path, 'upstart')): - log('Path {} is already configured as an OSD - bailing'.format(path)) - return + for t in ['upstart', 'systemd']: + if os.path.exists(os.path.join(path, t)): + log('Path {} is already used as an OSD dir - bailing'.format(path)) + return if cmp_pkgrevno('ceph', "0.56.6") < 0: log('Unable to use directories for OSDs with ceph < 0.56.6',