Project

General

Profile

Bug #18163

platform.linux_distribution() is deprecated; stop using it

Added by Tim Serong about 3 years ago. Updated 2 months ago.

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

0%

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

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 Resolved

History

#1 Updated by Nathan Cutler about 3 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 almost 3 years ago

  • Status changed from New to Resolved

#3 Updated by Sage Weil almost 3 years ago

  • Status changed from Resolved to 12

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

#4 Updated by Nathan Cutler over 1 year ago

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

#5 Updated by Nathan Cutler over 1 year ago

  • Status changed from 12 to Fix Under 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 over 1 year ago

  • Backport set to mimic,luminous

#7 Updated by Nathan Cutler over 1 year ago

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

#8 Updated by Yuri Weinstein over 1 year 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 over 1 year ago

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

#10 Updated by Nathan Cutler over 1 year ago

  • Backport changed from mimic,luminous to luminous

#11 Updated by Nathan Cutler 8 months ago

  • Status changed from Fix Under Review to Pending Backport

#12 Updated by Nathan Cutler 8 months ago

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

#13 Updated by Nathan Cutler 2 months ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved".

Also available in: Atom PDF