-
Notifications
You must be signed in to change notification settings - Fork 18
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
hosts: Add distro information to BaseLinuxHost #114
Conversation
2e10864
to
5cfe75b
Compare
Would it be better to use https://github.com/python-distro/distro instead? |
Is it expected that 'CI / tox' fail all targets with "docs-upstream: FAIL"? |
There is supposedly issue with docs/sphinx. |
@jakub-vavra-cz, what about this ^^ ? |
@alexey-tikhonov |
Pavel can provide his input on this when he is back but as this OS information is more generic and not SSSD specific, it should more likely be part of pytest-mh. I think it could be added as a new class in https://github.com/next-actions/pytest-mh/tree/master/pytest_mh/utils Or maybe added to https://github.com/next-actions/pytest-mh/blob/master/pytest_mh/utils/fs.py |
Hi, this sounds like a good idea. |
sssd_test_framework/hosts/base.py
Outdated
self._os_release: dict = {} | ||
self._distro_name: str | None = None | ||
self._distro_major: int | None = None | ||
self._distro_minor: int | None = 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.
It might be nicer to initialize here to some default values and move the call to _distro_information
into pytest_setup
and remove the @property
ies. It would simplify the code. But I don't insist, whatever you prefer.
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.
I added the default values.
For most tests we do not need the distro info so I would avoid code that is run for each test uselessly.
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.
It would be run only once, not for each test.
c10a78d
to
8e4c336
Compare
8e4c336
to
67d056d
Compare
Code-wise ack, I did not test it. |
@pbrezina
The file has an empty line:
|
cf909a4
to
cb5f714
Compare
Code works now. |
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.
Code-wise ack. I did not test it, I'll leave it to other reviewers.
If you'd like, you can simplify it more by using @cached_property
from functools
, you could remove the private properties form the constructor and make distro_information a cached property.
I fixed and tested the code and I do not want to do a major refactor again. |
cb5f714
to
30c3a72
Compare
Why did you unassigned @justin-stephenson and @alexey-tikhonov? |
We need distro information in order to match expected features to distros and versions.