]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Catch CommandFailedError and print debug info
authorZack Cerza <zack@cerza.org>
Tue, 3 Sep 2013 19:40:31 +0000 (14:40 -0500)
committerZack Cerza <zack@cerza.org>
Tue, 3 Sep 2013 19:40:31 +0000 (14:40 -0500)
teuthology/misc.py

index 7be8fb271a8feefa272a4a316f069ac72368aab7..bf9497b6102c7311b487f5c9bd80360faf76d2c5 100644 (file)
@@ -631,6 +631,7 @@ def get_scratch_devices(remote):
     retval = []
     for dev in devs:
         try:
+            # FIXME: Split this into multiple calls.
             remote.run(
                 args=[
                     # node exists
@@ -645,14 +646,14 @@ def get_scratch_devices(remote):
                     'mount',
                     run.Raw('|'),
                     'grep', '-q', dev,
-                    ]
-                )
+                ]
+            )
             retval.append(dev)
-        except Exception:
-            log.exception("Saw exception")
-            pass
+        except run.CommandFailedError:
+            log.debug("get_scratch_devices: %s is in use" % dev)
     return retval
 
+
 def wait_until_healthy(ctx, remote):
     """Wait until a Ceph cluster is healthy."""
     testdir = get_testdir(ctx)