Skip to content

Commit dfef157

Browse files
author
shan.wu
committed
<bug>[storage-device]: fix add multipath blacklist
'multipath -l -v1' execution will fail when the device is added to multipath blacklist Resolves: ZSTAC-49061 Change-Id: 6e6529eb57034973b26bb33a955976ae
1 parent 44e39a9 commit dfef157

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

kvmagent/kvmagent/plugins/storage_device.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ def refresh_mpath(disks_by_path):
313313
devpaths = [os.path.realpath(os.path.join("/dev/disk/by-path", s)) for s in disks_by_path]
314314
mpaths = set()
315315
for devpath in devpaths:
316-
if devpath: mpaths.add(shell.call("multipath -l -v1 "+devpath).strip())
316+
r, o = bash.bash_ro("multipath -l -v1 %s" % devpath)
317+
if r == 0 and o.strip() != "":
318+
mpaths.add(o.strip())
317319
for mpath in mpaths:
318320
if mpath: shell.run("multipathd resize map "+mpath)
319321

0 commit comments

Comments
 (0)