Skip to content

Commit

Permalink
Fix check_idmap_xml_filesystem_device failure
Browse files Browse the repository at this point in the history
Previously use name in line to get user id and group id.
In some cases, if there is one more name with same prefix in,it can get
wrong user information

Signed-off-by: chunfuwen <[email protected]>
  • Loading branch information
chunfuwen committed Sep 6, 2024
1 parent 37e94de commit 50efc5c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion virttest/utils_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ def _get_subid(id_filepath, name, info):
if result.exit_status:
raise TestError("Couldn't read %s" % id_filepath)

entry = [l for l in result.stdout_text.split("\n") if name in l]
entry = [
l
for l in result.stdout_text.split("\n")
if name in l and name == l.split(":")[0]
]
if not entry:
raise TestError("No entry for %s found in %s" % (name, id_filepath))

Expand Down

0 comments on commit 50efc5c

Please sign in to comment.