]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume simple.scan if mounted device cannot be detected, raise an error
authorAlfredo Deza <adeza@redhat.com>
Wed, 8 Nov 2017 14:46:20 +0000 (09:46 -0500)
committerAlfredo Deza <adeza@redhat.com>
Thu, 9 Nov 2017 17:02:14 +0000 (12:02 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/devices/simple/scan.py

index df916e73ea09292863257206d8327c53df802b6f..905baf415889c06c0490d1fdd74c0f64f02416d0 100644 (file)
@@ -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