Project

General

Profile

Actions

Bug #18163

closed

platform.linux_distribution() is deprecated; stop using it

Added by Tim Serong over 7 years ago. Updated over 4 years 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 (v1):
Crash signature (v2):

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 2 (0 open2 closed)

Has duplicate devops - Bug #23781: ceph-detect-init still uses python's platform libDuplicate04/18/2018

Actions
Copied to Ceph - Backport #39277: luminous: platform.linux_distribution() is deprecated; stop using itResolvedNathan CutlerActions
Actions #1

Updated by Nathan Cutler over 7 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.

Actions #2

Updated by Sage Weil over 7 years ago

  • Status changed from New to Resolved
Actions #3

Updated by Sage Weil over 7 years ago

  • Status changed from Resolved to 12

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

Actions #4

Updated by Nathan Cutler about 6 years ago

  • Has duplicate Bug #23781: ceph-detect-init still uses python's platform lib added
Actions #5

Updated by Nathan Cutler about 6 years 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

Actions #6

Updated by Nathan Cutler almost 6 years ago

  • Backport set to mimic,luminous
Actions #7

Updated by Nathan Cutler almost 6 years ago

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

Actions #8

Updated by Yuri Weinstein almost 6 years 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

Actions #9

Updated by Nathan Cutler over 5 years ago

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

Actions #10

Updated by Nathan Cutler over 5 years ago

  • Backport changed from mimic,luminous to luminous
Actions #11

Updated by Nathan Cutler about 5 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #12

Updated by Nathan Cutler about 5 years ago

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

Updated by Nathan Cutler over 4 years 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".

Actions

Also available in: Atom PDF