Merge "Handle different device outputs for multipath"

This commit is contained in:
Zuul 2023-11-22 21:36:40 +00:00 committed by Gerrit Code Review
commit 7a4114512c
3 changed files with 13 additions and 4 deletions

View File

@ -274,11 +274,15 @@ def _get_multipath_parent_device(device):
# size=56G features='1 retain_attached_hw_handler' hwhandler='0' wp=rw
# `-+- policy='service-time 0' prio=1 status=active
# `- 0:0:0:0 sda 8:0 active ready running
# Other format:
# mpathat (wwid/alias) device_name vendor,product
try:
lines = out.splitlines()
mpath_device = lines[0].split(' ')[1]
# give back something like dm-0 so we can log it.
return mpath_device
mpath_device_out = lines[0].split(' ')
for mpath_device in mpath_device_out:
if mpath_device.startswith("dm"):
# give back something like dm-0 so we can log it.
return mpath_device
except IndexError:
# We didn't get any command output, so Nope.
pass

View File

@ -1764,7 +1764,7 @@ MULTIPATH_VALID_PATH = '%s is a valid multipath device path'
MULTIPATH_INVALID_PATH = '%s is not a valid multipath device path'
MULTIPATH_LINKS_DM = (
'SUPER_FRIENDLY_NAME %s ATA,INTEL SSDSC2CT06\n'
'SUPER_FRIENDLY_ NAME (12345) %s ATA, INTEL SSDSC2CT06\n'
'size=56G features=\'1 retain_attached_hw_handler\' hwhandler=\'0\' wp=rw\n' # noqa
' `-+- policy=\'service-time 0\' prio=1 status=active\n'
' `- 0:0:0:0 device s 8:0 active ready running\n'

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fix the logic to detect the right parent device for a given multipath
device.