Project

General

Profile

Bug #18164

platform.linux_distribution() fails on distros with /etc/os-release only

Added by Tim Serong almost 3 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
12/07/2016
Due date:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature:

Description

As with bugs #18141 and #18163, on the latest SUSE systems, platform.linux_distribution() returns ('','',''), causing ceph-deploy to fail with "UnsupportedPlatform: Platform is not supported:"

Given platform.linux_distribution() is deprecated and doesn't understand /etc/os-release, we should stop using it.

History

#1 Updated by Alfredo Deza almost 3 years ago

  • Status changed from New to Feedback

It is deprecated? Can you expand on this? It does work for a lot of different distros. If it doesn't work for SUSE only, I would be in favor of adding support
for SUSE vs. removing it completely, and looking for an alternative

#2 Updated by Alfredo Deza almost 3 years ago

  • Subject changed from platform.linux_distribution() is deprecated; stop using it to platform.linux_distribution() fails on distros with /etc/os-release only
  • Status changed from Feedback to Verified

ceph-deploy will not stop using linux_platform() but will have to check for os-release and attempt to infer the same details from it when linux_platform() comes empty handed

#3 Updated by Nathan Cutler almost 3 years ago

ceph-deploy will not stop using linux_platform() but will have to check for os-release and attempt to infer the same details from it when linux_platform() comes empty handed

+1 sounds good to me

#4 Updated by Tim Serong almost 3 years ago

Alfredo Deza wrote:

It is deprecated? Can you expand on this? It does work for a lot of different distros. If it doesn't work for SUSE only, I would be in favor of adding support
for SUSE vs. removing it completely, and looking for an alternative

My apologies for not providing a more thorough description. To clarify: https://docs.python.org/3/library/platform.html#platform.linux_distribution says "Deprecated since version 3.5, will be removed in version 3.7." I know that's not a problem for Python 2.x (the function is still there), but given it's going away in 3.x, I'd be surprised if anyone would spend time making it understand /etc/os-release in 2.x. If other (non-SUSE) distros ultimately go forwards with /etc/os-release instead of distro specific release files, this means platform.linux_distribution() will eventually be useless even on python 2.x.

ceph-deploy will not stop using linux_platform() but will have to check for os-release and attempt to infer the same details from it when linux_platform() comes empty handed

That'll work :-)

#6 Updated by Alfredo Deza over 1 year ago

  • Status changed from Verified to Resolved

merged commit b057610 into master

Also available in: Atom PDF