Project

General

Profile

Bug #18163

platform.linux_distribution() is deprecated; stop using it

Added by Tim Serong over 2 years ago. Updated 2 months ago.

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

0%

Source:
Tags:
Backport:
luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

platform.linux_distribution() is deprecated, so we should stop using it. Notably it uses /etc/SuSE-release on SUSE systems, and the latest SUSE versions don't ship this file; instead they ship /etc/os-release, which platform.linux_distribution() doesn't know about, so it returns ('','','').

AFAICT, platform.linux_distribution() is currently used by ceph-detect-init, which in turn is used by ceph-disk. If ceph-detect-init can't determine the distro because it sees ('','',''), this results in ceph-disk always tagging the init system as sysvinit.

There are also platform.linux_distribution() invocations in qa/workunits/ceph-disk/ceph-disk-no-lockbox and src/ceph-disk/ceph_disk/main.py, but they look like dead code to me.

See also bug #18141


Related issues

Duplicated by devops - Bug #23781: ceph-detect-init still uses python's platform lib Duplicate 04/18/2018
Copied to Ceph - Backport #39277: luminous: platform.linux_distribution() is deprecated; stop using it In Progress

History

#1 Updated by Nathan Cutler over 2 years ago

lsb-release is no longer a Ceph runtime dependency, but is still a Ceph build dependency - see #17425

Getting rid of lsb-release as a build dependency is a laudable goal IMO and dropping all calls to platform.linux_distribution() is a part of that.

#2 Updated by Sage Weil over 2 years ago

  • Status changed from New to Resolved

#3 Updated by Sage Weil over 2 years ago

  • Status changed from Resolved to Verified

oops, ceph-detect-init is still using it.

#4 Updated by Nathan Cutler about 1 year ago

  • Duplicated by Bug #23781: ceph-detect-init still uses python's platform lib added

#5 Updated by Nathan Cutler about 1 year ago

  • Status changed from Verified to Need Review
  • Assignee set to Nathan Cutler

This bug is no longer applicable to master, because ceph-detect-init has been dropped there.

mimic PR: https://github.com/ceph/ceph/pull/21523

#6 Updated by Nathan Cutler 11 months ago

  • Backport set to mimic,luminous

#7 Updated by Nathan Cutler 11 months ago

first mimic follow-on PR (not a regression - just expands coverage): https://github.com/ceph/ceph/pull/23111

#8 Updated by Yuri Weinstein 11 months ago

Nathan Cutler wrote:

This bug is no longer applicable to master, because ceph-detect-init has been dropped there.

mimic PR: https://github.com/ceph/ceph/pull/21523

merged

#9 Updated by Nathan Cutler 11 months ago

second mimic follow-on PR (fix RHEL 7.5 regression): https://github.com/ceph/ceph/pull/23303

#10 Updated by Nathan Cutler 11 months ago

  • Backport changed from mimic,luminous to luminous

#11 Updated by Nathan Cutler 2 months ago

  • Status changed from Need Review to Pending Backport

#12 Updated by Nathan Cutler 2 months ago

  • Copied to Backport #39277: luminous: platform.linux_distribution() is deprecated; stop using it added

Also available in: Atom PDF