From 6b2fc4c0ba63e4bd51774ea09cc6542738128621 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 8 Nov 2017 09:46:20 -0500 Subject: [PATCH] ceph-volume simple.scan if mounted device cannot be detected, raise an error Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/devices/simple/scan.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ceph-volume/ceph_volume/devices/simple/scan.py b/src/ceph-volume/ceph_volume/devices/simple/scan.py index df916e73ea092..905baf415889c 100644 --- a/src/ceph-volume/ceph_volume/devices/simple/scan.py +++ b/src/ceph-volume/ceph_volume/devices/simple/scan.py @@ -79,6 +79,9 @@ class Scan(object): device = path_mounts.get(path) # it is possible to have more than one device, pick the first one, and # warn that it is possible that more than one device is 'data' + if not device: + terminal.error('Unable to detect device mounted for path: %s' % path) + raise RuntimeError('Cannot activate OSD') osd_metadata['data'] = self.scan_device(device[0] if len(device) else None) return osd_metadata -- 2.39.5