Comment 0 for bug 1864993

Revision history for this message
Albert Damen (albrt) wrote :

Running ceph-deploy in focal, using python3.8, results in an error message:

[ceph_deploy][ERROR ] RuntimeError: AttributeError: module 'platform' has no attribute 'linux_distribution'

It turns out platform.linux_distribution has been removed from python 3.8
(bpo-28167: Remove platform.linux_distribution, which was deprecated since 3.5.)

One option may be to use the new distro module from https://pypi.org/project/distro/

As ceph-deploy already can use os-release as a fall-back option, I changed ceph-deploy to use that as the first option and could create a working ceph cluster.

--- /usr/lib/python3/dist-packages/ceph_deploy/hosts/remotes.py.bak 2020-02-21 16:12:36.716000000 +0000
+++ /usr/lib/python3/dist-packages/ceph_deploy/hosts/remotes.py 2020-02-21 16:13:14.376000000 +0000
@@ -13,10 +13,10 @@

 def platform_information(_linux_distribution=None):
     """ detect platform information from remote host """
- linux_distribution = _linux_distribution or platform.linux_distribution
- distro, release, codename = linux_distribution()
- if not distro:
- distro, release, codename = parse_os_release()
+ #linux_distribution = _linux_distribution or platform.linux_distribution
+ #distro, release, codename = linux_distribution()
+ #if not distro:
+ distro, release, codename = parse_os_release()
     if not codename and 'debian' in distro.lower(): # this could be an empty string in Debian
         debian_codenames = {
             '10': 'buster',