From 6e19593b6046f6732e6c5c191bc3dcdfb72a4bd7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 23 Nov 2019 09:02:28 -0600 Subject: [PATCH] ceph-daemon: make infer_fsid behave when /var/lib/ceph dne Signed-off-by: Sage Weil --- src/ceph-daemon/ceph-daemon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ceph-daemon/ceph-daemon b/src/ceph-daemon/ceph-daemon index 9e4216f3b3d..85bc175afe2 100755 --- a/src/ceph-daemon/ceph-daemon +++ b/src/ceph-daemon/ceph-daemon @@ -219,10 +219,10 @@ def infer_fsid(func): return func() fsid_list = [] - for i in os.listdir(args.data_dir): - if is_fsid(i): - fsid_list.append(i) - + if os.path.exists(args.data_dir): + for i in os.listdir(args.data_dir): + if is_fsid(i): + fsid_list.append(i) logger.debug('Found fsids %s' % str(fsid_list)) if not fsid_list: -- 2.39.5