Fix python version module compatible (TEAM-11049)#311
Open
Dawei-Pang wants to merge 1 commit intoClusterLabs:masterfrom
Open
Fix python version module compatible (TEAM-11049)#311Dawei-Pang wants to merge 1 commit intoClusterLabs:masterfrom
Dawei-Pang wants to merge 1 commit intoClusterLabs:masterfrom
Conversation
8608f82 to
1d6bfa6
Compare
mpagot
reviewed
Mar 19, 2026
Contributor
|
LGTM, thanks |
e2e_test/hawk_test.py
Outdated
| # Get version from /etc/os-release | ||
| test_version = ssh.ssh.exec_command("grep VERSION= /etc/os-release")[1].read().decode().strip().split("=")[1].strip('"') | ||
| # Get VERSION_ID from /etc/os-release | ||
| _, out, err = ssh.ssh.exec_command('. /etc/os-release && echo $VERSION_ID') |
Contributor
There was a problem hiding this comment.
Elsewhere the test is doing: https://github.com/ClusterLabs/hawk/blob/master/e2e_test/hawk_test_results.py#L35-L37
Which is perhaps harder to read, but avoids running a shell.
Perhaps we can move those 3 lines here, then do:
test_version = osrel['VERSION_ID']
And then pass the PRETTY_NAME as an argument to results = ResultSet() (which is some lines above), like:
results = ResultSet(osrel['PRETTY_NAME'])
results.add_ssh_tests()
In any case, I'm approving. Changes LGTM.
Contributor
Author
There was a problem hiding this comment.
Thanks, would you please help to review again?
1d6bfa6 to
3bd5b85
Compare
alvarocarvajald
approved these changes
Mar 20, 2026
Comment on lines
+113
to
+114
| _, out, err = ssh.ssh.exec_command('cat /etc/os-release') | ||
| lines = out.read().decode('utf-8').splitlines() |
Contributor
There was a problem hiding this comment.
Why not?
with open('/etc/os-release', encoding="utf-8") as file:
lines = file.read().splitlines()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running the head of master branch, we observed the followed problem, for example: https://openqa.suse.de/tests/21364964#step/hawk_gui/89
Filed a JIRA ticket https://jira.suse.com/browse/TEAM-11049
After some research, commit cbcd346 modified
from distutils.version import LooseVersion as Versiontofrom packaging.version import VersionThe new "Version" method cannot accept the string like "15-SP7" directly, so I would like to check
VERSION_IDin /etc/os-release instead ofVERSIONfor compatible.VRs:
https://openqa.suse.de/tests/21450880 15-SP4
https://openqa.suse.de/tests/21450874 15-SP5
https://openqa.suse.de/tests/21451116 15-SP6
https://openqa.suse.de/tests/21450865 15-SP7
https://openqa.suse.de/tests/21426733 16.0 (pending)