Merge "Raise exception in find_multipath_device"

This commit is contained in:
Jenkins 2016-02-11 17:52:26 +00:00 committed by Gerrit Code Review
commit 71e5745fef
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()