Project

General

Profile

Actions

Bug #18141

closed

platform.linux_distribution() is deprecated; stop using it

Added by Nathan Cutler over 7 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
% Done:

0%

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

Description

platform.linux_distribution() is deprecated, so we should stop using it.

(For example, it uses /etc/SuSE-release on SUSE systems, and the latest SUSE versions do not ship this file.)

Given that we already have OS.from_os_release() in teuthology, it seems to me that we could simply rip out the code that uses platform.linux_distribution().

Actions #1

Updated by Tim Serong over 7 years ago

See also bug #18163

Actions #2

Updated by Nathan Cutler over 7 years ago

  • Status changed from In Progress to Fix Under Review
Actions #3

Updated by Alfredo Deza over 7 years ago

I don't see how this is deprecated. Can you elaborate a bit how this doesn't work?

vagrant@sles12-sp1:~> python
Python 2.7.9 (default, Dec 21 2014, 11:02:59) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.linux_distribution()
('SUSE Linux Enterprise Server ', '12', 'x86_64')
>>>
Actions #4

Updated by Nathan Cutler over 7 years ago

@Alfredo: SLES 12 has /etc/SuSE-release. Try Tumbleweed, for example, where you will get ('', '', ''). If you have access to the latest Fedora, you might be able to reproduce this behavior there, too.

Actions #5

Updated by Nathan Cutler over 5 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF