From 868c0a73be12ceb9098864eb2d9a0123a80d13ff Mon Sep 17 00:00:00 2001 From: Ron Allred Date: Wed, 23 May 2018 08:34:41 -0600 Subject: [PATCH] ceph-volume util/prepare.py Replaces PR#21887 Rename function check_id to osd_id_exists in util/prepare.py Fix boolean analysis of osd_id_exists when --osd-id is provided on command line Signed-off-by: Ron Allred (cherry picked from commit 4641ebb075adc987e83d7440f9756104fc04f83a) --- src/ceph-volume/ceph_volume/util/prepare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ceph-volume/ceph_volume/util/prepare.py b/src/ceph-volume/ceph_volume/util/prepare.py index d1cddf073a697..f7dcdcb0988d7 100644 --- a/src/ceph-volume/ceph_volume/util/prepare.py +++ b/src/ceph-volume/ceph_volume/util/prepare.py @@ -64,7 +64,7 @@ def create_id(fsid, json_secrets, osd_id=None): '-i', '-', 'osd', 'new', fsid ] - if check_id(osd_id): + if osd_id is not None and not osd_id_exists(osd_id): cmd.append(osd_id) stdout, stderr, returncode = process.call( cmd, @@ -76,7 +76,7 @@ def create_id(fsid, json_secrets, osd_id=None): return ' '.join(stdout).strip() -def check_id(osd_id): +def osd_id_exists(osd_id): """ Checks to see if an osd ID exists or not. Returns True if it does exist, False if it doesn't. -- 2.39.5