Project

General

Profile

Bug #23781

ceph-detect-init still uses python's platform lib

Added by Joshua Schmid over 1 year ago. Updated over 1 year ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
ceph-disk
Target version:
Start date:
04/18/2018
Due date:
% Done:

0%

Source:
Community (dev)
Tags:
ceph-disk ceph-detect-init
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

When 'ceph-detect-init --default sysvinit' is called on a modern system that uses /etc/os-release it will return 'sysvinit' due to a ('','','') return from 'platform.linux_distribution'

See deprecation message here:
https://bugs.python.org/issue1322

This has the following effect:

The initial call mentioned above is used in ceph-disk's 'init_get()' function which in turn is responsible for detecting and then writing a identifier file during the osd preparation.

On a /etc/os-release distro this will result in:

data4:~ # ls /var/lib/ceph/osd/ceph-13/sysvinit
/var/lib/ceph/osd/ceph-13/sysvinit

Where on a systemd system there should be a:

data1@12SP3:~ # ls /var/lib/ceph/osd/ceph-6/systemd
/var/lib/ceph/osd/ceph-6/systemd

That again gets read by ceph-disks activate call which identifies the system as a 'initV' system and calls:

'/usr/sbin/service ceph --cluster ceph start osd.$ID'

instead of 'systemctl start ceph-osd@$ID'

which of course fails.

It's hard to notice in the first place because the initial deployment activates the disk correctly, which will present you with a running cluster. Only after rebooting a node the OSDs will no longer activate their services.

A proper(python3+) fix would be to rewrite the 'ceph-detect-init' script using the proposed 'python-distro' lib.


Related issues

Duplicates Ceph - Bug #18163: platform.linux_distribution() is deprecated; stop using it Resolved 12/07/2016

History

#1 Updated by Nathan Cutler over 1 year ago

A proper(python3+) fix would be to rewrite the 'ceph-detect-init' script using the proposed 'python-distro' lib.

ceph-detect-init is only used by ceph-disk, and ceph-disk is supposed to be removed in Nautilus, which means that ceph-detect-init will likely be removed in Nautilus, too. Both are in "minimal bugfixes only" maintenance mode which means:

(a) "rewrite" is probably not a good word to use
(b) waiting for a proposed future module is not really an option either

Much as I would like all the Python code in Ceph to run on Python 3 right now, more realistically ceph-disk and ceph-detect-init could be left on Python 2 until their retirement (although their unit tests run on Python 3 as well, so maybe migrating them to Python 3 is not that unrealistic).

#2 Updated by Nathan Cutler over 1 year ago

  • Status changed from New to Duplicate

#3 Updated by Nathan Cutler over 1 year ago

  • Duplicates Bug #18163: platform.linux_distribution() is deprecated; stop using it added

Also available in: Atom PDF