Commit 20a0c9ef authored by Guido Trotter's avatar Guido Trotter
Browse files

When an assembly error occurs log it too

Right now an assembly error produces an exception but not a log message. This
is bad because the exception suggests looking at the log, but the log itself
has a lot of errors which are not really a problem and only some which really
is. In order to make it clear where in the log the problem occurred we log a
message too, before raising the exception.

Reviewed-by: iustinp
parent ebe8ef17
......@@ -660,9 +660,10 @@ def CreateBlockDevice(disk, size, owner, on_primary, info):
(disk, size))
if on_primary or disk.AssembleOnSecondary():
if not device.Assemble():
raise errors.BlockDeviceError("Can't assemble device after creation,"
" very unusual event - check the node"
" daemon logs")
errorstring = "Can't assemble device after creation"
raise errors.BlockDeviceError("%s, very unusual event - check the node"
" daemon logs" % errorstring)
if on_primary or disk.OpenOnSecondary():
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment