]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-disk: fix lockbox set_or_create_partition()
authoryouji <youji@ebay.com>
Fri, 8 Apr 2016 15:29:45 +0000 (08:29 -0700)
committeryouji <youji@ebay.com>
Mon, 11 Apr 2016 12:28:13 +0000 (05:28 -0700)
Signed-off-by: You Ji <youji@ebay.com>
src/ceph-disk/ceph_disk/main.py

index c13cda44df8a35ec9d30f3d4b1fed873b81eff7f..996557fa74ee9ba04fd4870553c1752c2044fb4b 100755 (executable)
@@ -122,7 +122,7 @@ class Ptype(object):
 
     @staticmethod
     def get_ready_by_name(name):
-        return [x[name]['ready'] for x in PTYPE.values()]
+        return [x[name]['ready'] for x in PTYPE.values() if name in x]
 
     @staticmethod
     def is_regular_space(ptype):
@@ -2241,8 +2241,8 @@ class Lockbox(object):
                       self.args.lockbox)
             self.partition = DevicePartition.factory(
                 path=None, dev=self.args.lockbox, args=self.args)
-            ptype = partition.get_ptype()
-            ready = Ptype.get_ready_by_type('lockbox')
+            ptype = self.partition.get_ptype()
+            ready = Ptype.get_ready_by_name('lockbox')
             if ptype not in ready:
                 LOG.warning('incorrect partition UUID: %s, expected %s'
                             % (ptype, str(ready)))