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.)
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.
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',
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_distribut ion has been removed from python 3.8 linux_distribut ion, which was deprecated since 3.5.)
(bpo-28167: Remove platform.
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 python3/ dist-packages/ ceph_deploy/ hosts/remotes. py 2020-02-21 16:13:14.376000000 +0000
+++ /usr/lib/
@@ -13,10 +13,10 @@
def platform_ information( _linux_ distribution= None): linux_distribut ion ion() linux_distribut ion ion()
debian_ codenames = {
""" detect platform information from remote host """
- linux_distribution = _linux_distribution or platform.
- distro, release, codename = linux_distribut
- if not distro:
- distro, release, codename = parse_os_release()
+ #linux_distribution = _linux_distribution or platform.
+ #distro, release, codename = linux_distribut
+ #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
'10': 'buster',