]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: do not stop activate-all on first failure
authorSage Weil <sage@inktank.com>
Sun, 16 Jun 2013 03:06:33 +0000 (20:06 -0700)
committerSage Weil <sage@inktank.com>
Mon, 17 Jun 2013 18:16:41 +0000 (11:16 -0700)
Keep going even if we hit one activation error.  This avoids failing to
start some disks when only one of them won't start (e.g., because it
doesn't belong to the current cluster).

Signed-off-by: Sage Weil <sage@inktank.com>
src/ceph-disk

index cd3b6cce3d5dbede360342419fd643cdf3cfaf20..26097c8e0897371950ec8d4f54c7473df30c0a5e 100755 (executable)
@@ -1694,6 +1694,7 @@ def main_activate_all(args):
     LOG.debug('Scanning %s', dir)
     if not os.path.exists(dir):
         return
+    err = False
     for name in os.listdir(dir):
         if name.find('.') < 0:
             continue
@@ -1713,11 +1714,17 @@ def main_activate_all(args):
                     osd_id=osd_id,
                     )
 
-            except:
-                raise
+            except Exception as e:
+                print >> sys.stderr, '{prog}: {msg}'.format(
+                    prog=args.prog,
+                    msg=e,
+                    )
+                err = True
 
             finally:
                 activate_lock.release()
+    if err:
+        raise Error('One or more partitions failed to activate')
 
 
 ###########################