From: Alfredo Deza Date: Wed, 8 Nov 2017 14:46:20 +0000 (-0500) Subject: ceph-volume simple.scan if mounted device cannot be detected, raise an error X-Git-Tag: v12.2.2~23^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=32913844b36285aae40f9786e5cb035bfca22f2d;p=ceph.git ceph-volume simple.scan if mounted device cannot be detected, raise an error Signed-off-by: Alfredo Deza (cherry picked from commit 6b2fc4c0ba63e4bd51774ea09cc6542738128621) --- diff --git a/src/ceph-volume/ceph_volume/devices/simple/scan.py b/src/ceph-volume/ceph_volume/devices/simple/scan.py index df916e73ea09..905baf415889 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