bdev: add and use two utility functions
authorIustin Pop <iustin@google.com>
Mon, 9 Feb 2009 14:03:47 +0000 (14:03 +0000)
committerIustin Pop <iustin@google.com>
Mon, 9 Feb 2009 14:03:47 +0000 (14:03 +0000)
commit82463074c0c011a83cf2239affbdb44cb2940801
tree11d350ad12c0cd6ef1edbaf04ba801c3419ff57d
parent23829f6ff20cbb0cdb5e287e24c3a2e1555bcc1f
bdev: add and use two utility functions

This patch adds two utility functions for raising BlockDeviceError
exceptions and for running functions while ignoring this error. Most of
the manual “raise errors.BlockDeviceError” cases are converted to
_ThrowError, as this makes the code clearer.

We also change most of the DRBD error messages to include the minor
number because with the parallel execution of commands it's not longer
possible to identify the failed DRBD just from the timestamp, and the
minor number can be mapped back to the instance easier.

Reviewed-by: ultrotter
lib/bdev.py