]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commit
[RM-18164] Use /etc/os-release if platform.linux_distribution() empty 453/head
authorTim Serong <tserong@suse.com>
Wed, 6 Sep 2017 05:53:32 +0000 (15:53 +1000)
committerTim Serong <tserong@suse.com>
Mon, 18 Sep 2017 15:34:32 +0000 (17:34 +0200)
commit31330b9a3a71543f2b1568679e3be6fe881ecd32
treeaa359614644fe4a013979513ce06850f3be50d2d
parent2312b19a5653b39cb5a80154e63ea57d545d3a10
[RM-18164] Use /etc/os-release if platform.linux_distribution() empty

On systems with only /etc/os-release (rather than distro-specific
release files), platform.linux_distribution() returns ('', '', '').
In this case, fall back to parsing /etc/os-release instead.

It would better to flip the ordering, and use /etc/os-release first,
with platform.linux_distribution() as a fallback.  There's tests for
seven different distros' os-release files already, but we may want
more before flipping this around.

(It would be better still to just use the distro.linux_distribution()
function, especially since platform.linux_distribution() is
deprecated, but I don't know that there's a way of ensuring that
module is present in advance on all the remote hosts.)

Fixes: http://tracker.ceph.com/issues/18164
Signed-off-by: Tim Serong <tserong@suse.com>
ceph_deploy/hosts/__init__.py
ceph_deploy/hosts/remotes.py
ceph_deploy/tests/test_remotes.py