Skip to content

Commit

Permalink
Discard paths from disk.md sub_devs parsed from mdadm -E --scan -v
Browse files Browse the repository at this point in the history
mdadm lists both multipaths and paths as legs of the raid.
  • Loading branch information
cvaroqui committed Feb 6, 2018
1 parent b444c82 commit ed86417
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/resDiskMdLinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,15 @@ def sub_devs_inactive(self):
if inblock and "devices=" in line:
l = line.split("devices=")[-1].split(",")
l = map(lambda x: os.path.realpath(x), l)
paths = set()
for dev in l:
devs |= set(dev_to_paths(dev))
_paths |= dev_to_paths(dev)
if set([dev]) != _paths:
paths |= _paths
devs.add(dev)
break
# discard paths from the list (mdadm shows both mpaths and paths)
devs -= paths

self.log.debug("found devs %s held by md %s" % (devs, self.uuid))
return devs
Expand Down

0 comments on commit ed86417

Please sign in to comment.