]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: should throw if fail to read key-management-mode
authorKefu Chai <kchai@redhat.com>
Tue, 28 Nov 2017 06:41:31 +0000 (14:41 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 28 Nov 2017 06:55:33 +0000 (14:55 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/ceph-disk/ceph_disk/main.py

index 888c85a3fe5244468cf6a03a19d45147214dfa83..798072ce8a79d707f8f8f376f14c9fb82572a113 100644 (file)
@@ -1292,6 +1292,8 @@ def get_dmcrypt_key(
     path = os.path.join(STATEDIR, 'osd-lockbox', _uuid)
     if os.path.exists(path):
         mode = get_oneliner(path, 'key-management-mode')
+        if mode is None:
+            raise Error('unable to read key-management-mode from %s' % path)
         osd_uuid = get_oneliner(path, 'osd-uuid')
         ceph_fsid = read_one_line(path, 'ceph_fsid')
         if ceph_fsid is None: