]> 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>
Mon, 16 Jul 2018 18:17:10 +0000 (13:17 -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>
src/ceph-volume/ceph_volume/util/prepare.py

index b982f3c67cc27ae83ebd759073df1e87a8bb1e6a..59d60fc0cbeeb169e07033891a469aab890aa705 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.