Raise exception in find_multipath_device

When failed to execute "multipath -l" in find_multipath_device,
raise an exception instead of printing warning only.

Change-Id: I593b49d1637c7077e51a2db343e5b1eec3053536
Closes-Bug: #1519363
This commit is contained in:
felix23ma 2015-11-24 22:08:11 +08:00
parent 4b3dbdcb2f
commit 2b051f7fa2
2 changed files with 6 additions and 1 deletions

View File

@ -128,3 +128,7 @@ class VolumeGroupNotFound(BrickException):
class VolumeGroupCreationFailed(BrickException):
message = _("Failed to create Volume Group: %(vg_name)s")
class CommandExecutionFailed(BrickException):
message = _("Failed to execute command %(cmd)s")

View File

@ -266,7 +266,8 @@ class LinuxSCSI(executor.Executor):
except putils.ProcessExecutionError as exc:
LOG.warning(_LW("multipath call failed exit %(code)s"),
{'code': exc.exit_code})
return None
raise exception.CommandExecutionFailed(
cmd='multipath -l %s' % device)
if out:
lines = out.strip()