From 0182973b66d449552d17248e27cd12c470137ea9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 29 Mar 2013 13:59:04 -0700 Subject: [PATCH] ceph-disk: handle missing journal_uuid field gracefully Only lower if we know it's not None. Signed-off-by: Sage Weil (cherry picked from commit 562e1716bd4b5372716e502a5e4dd872d381bfb7) --- src/ceph-disk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ceph-disk b/src/ceph-disk index c1d6a4d2cdc21..71c3a75b54dad 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1671,9 +1671,11 @@ def more_osd_info(path, uuid_map): if who: desc.append('osd.%s' % who) - journal_uuid = get_oneliner(path, 'journal_uuid').lower() - if journal_uuid and journal_uuid in uuid_map: - desc.append('journal %s' % uuid_map[journal_uuid]) + journal_uuid = get_oneliner(path, 'journal_uuid') + if journal_uuid: + journal_uuid = journal_uuid.lower() + if journal_uuid in uuid_map: + desc.append('journal %s' % uuid_map[journal_uuid]) return desc @@ -1747,9 +1749,9 @@ def main_list(args): try: tpath = mount(dev=dev, fstype=fs, options='') try: - journal_uuid = get_oneliner(tpath, 'journal_uuid').lower() + journal_uuid = get_oneliner(tpath, 'journal_uuid') if journal_uuid: - journal_map[journal_uuid] = dev + journal_map[journal_uuid.lower()] = dev finally: unmount(tpath) except: -- 2.39.5