]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume util/prepare.py
authorRon Allred <rallred@itrefined.com>
Wed, 23 May 2018 14:34:41 +0000 (08:34 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 17 Jul 2018 19:38:22 +0000 (14:38 -0500)
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 <rallred@itrefined.com>
(cherry picked from commit 4641ebb075adc987e83d7440f9756104fc04f83a)

src/ceph-volume/ceph_volume/util/prepare.py

index d1cddf073a6978c22989c4d3b20d58043e4c677a..f7dcdcb0988d7a5956fc4775f09ee676f80699e6 100644 (file)
@@ -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.