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

crm cluster health uses platform.linux_distribution, dropped in python 3.8 #879

Closed
athos-ribeiro opened this issue Oct 13, 2021 · 1 comment

Comments

@athos-ribeiro
Copy link
Contributor

scripts/health/collect.py relies on a call to platform.linux_distribution, which has been deprecated since Python 3.5 and was removed on python 3.8 [1].

This results in errors for crm cluster health calls on systems with python >= 3.8.

Until Python 3.7, when platform.linux_distribution was still present and deprecated, the Python docs suggested using distro [3] as an alternative, which could be a solution for this issue. However, distro itself requires python >= 3.6, which could imply losing support for python 3.4 and 3.5 or implementing a fallback logic to use platform.linux_distribution when available.

[1] https://bugs.python.org/issue28167
[2] https://docs.python.org/3.7/library/platform.html#platform.linux_distribution
[3] https://pypi.org/project/distro/

@liangxin1300
Copy link
Collaborator

liangxin1300 commented Nov 2, 2021

@athos-ribeiro Thanks for pointing this!
To be honest, the content in scripts/health/collect.py seems duplicated a little, comparing with codes in crmsh/report
So here I want to reuse the function get_distro_info from crmsh/report/utillib.py, see c90a4e6
and #883

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants