]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: re-using an OSD partition bugous test
authorLoic Dachary <ldachary@redhat.com>
Thu, 25 Feb 2016 05:49:59 +0000 (12:49 +0700)
committerLoic Dachary <ldachary@redhat.com>
Fri, 4 Mar 2016 02:13:35 +0000 (09:13 +0700)
When re-using an OSD partition, the test of the partition type is done
against a non-existent variable.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/ceph-disk/ceph_disk/main.py

index 250d1e79eca26ae7fc0a066951770c7377457158..133e404162501d016d603b884f7385082fb00c17 100755 (executable)
@@ -2329,9 +2329,10 @@ class PrepareData(object):
             self.partition = DevicePartition.factory(
                 path=None, dev=self.args.data, args=self.args)
             ptype = partition.get_ptype()
-            if ptype != ptype_osd:
+            ready = Ptype.get_ready_by_type('osd')
+            if ptype not in ready:
                 LOG.warning('incorrect partition UUID: %s, expected %s'
-                            % (ptype, ptype_osd))
+                            % (ptype, str(ready)))
         else:
             LOG.debug('Creating osd partition on %s',
                       self.args.data)