-
Notifications
You must be signed in to change notification settings - Fork 243
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
Fix check_idmap_xml_filesystem_device failure #3995
Fix check_idmap_xml_filesystem_device failure #3995
Conversation
previously it failed with below message: 2024-09-04 10:35:31,794 process L0658 INFO | Running 'cat /etc/subuid' 2024-09-04 10:35:31,802 process L0470 DEBUG| [stdout] jenkins:100000:65536 2024-09-04 10:35:31,803 process L0739 INFO | Command 'cat /etc/subuid' finished with 0 after 0.001282615s 2024-09-04 10:35:31,803 process L0470 DEBUG| [stdout] uri_test:165536:65536 2024-09-04 10:35:31,803 process L0470 DEBUG| [stdout] testacl:231072:65536 2024-09-04 10:35:31,803 process L0470 DEBUG| [stdout] test:296608:65536 2024-09-04 10:35:31,805 process L0658 INFO | Running 'cat /etc/subgid' 2024-09-04 10:35:31,811 process L0470 DEBUG| [stdout] jenkins:100000:65536 2024-09-04 10:35:31,811 process L0470 DEBUG| [stdout] uri_test:165536:65536 2024-09-04 10:35:31,811 process L0470 DEBUG| [stdout] testacl:231072:65536 2024-09-04 10:35:31,811 process L0470 DEBUG| [stdout] test:296608:65536... |
cleaning libvirtd logs... |
@smitterl ,please help have a look |
virttest/utils_ids.py
Outdated
@@ -61,7 +61,14 @@ def _get_subid(id_filepath, name, info): | |||
if not entry: | |||
raise TestError("No entry for %s found in %s" % (name, id_filepath)) | |||
|
|||
entry = entry[0].split(":") | |||
matched_entry = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @chunfuwen I wonder if we could have a shorter solution like the following:
entry = [l for l in result.stdout_text.split("\n") if name in l and name == l.split(":")[0]]
(I think name in l
is still necessary to avoid an issue if there were empty or malformed lines.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
c9d1669
to
baf4aff
Compare
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]>
baf4aff
to
50efc5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
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