Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multipath: Optimization method for obtaining multipath states #5893

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 12 additions & 5 deletions avocado/utils/multipath.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,18 @@ def get_path_status(disk_path):
mpath_op = get_multipath_details()
if not mpath_op:
return ("", "", "")
for maps in mpath_op["maps"]:
for path_groups in maps["path_groups"]:
for paths in path_groups["paths"]:
if paths["dev"] == disk_path:
return (paths["dm_st"], paths["dev_st"], paths["chk_st"])

paths_info = {}
for maps in mpath_op.get("maps", []):
for path_groups in maps.get("path_groups", []):
for paths in path_groups.get("paths", []):
paths_info[paths["dev"]] = (
paths["dm_st"],
paths["dev_st"],
paths["chk_st"],
)

return paths_info.get(disk_path, ("", "", ""))


def get_mpath_paths_status(wwid):
Expand Down