From 1312f3bc4cc6757bc66b40aa8953414431f4c917 Mon Sep 17 00:00:00 2001 From: Hong Zhiguo Date: Tue, 2 Jun 2015 16:43:15 +0800 Subject: [PATCH] support for distro Mint which is based on ubuntu Signed-off-by: Hong Zhiguo --- ceph_deploy/hosts/__init__.py | 2 ++ ceph_deploy/tests/unit/hosts/test_hosts.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/ceph_deploy/hosts/__init__.py b/ceph_deploy/hosts/__init__.py index 6762664..7699a1c 100644 --- a/ceph_deploy/hosts/__init__.py +++ b/ceph_deploy/hosts/__init__.py @@ -103,6 +103,8 @@ def _normalized_distro_name(distro): return 'suse' elif distro.startswith('centos'): return 'centos' + elif distro.startswith('linuxmint'): + return 'ubuntu' return distro diff --git a/ceph_deploy/tests/unit/hosts/test_hosts.py b/ceph_deploy/tests/unit/hosts/test_hosts.py index 4229ec6..c9d9c63 100644 --- a/ceph_deploy/tests/unit/hosts/test_hosts.py +++ b/ceph_deploy/tests/unit/hosts/test_hosts.py @@ -19,6 +19,10 @@ class TestNormalized(object): result = hosts._normalized_distro_name('Ubuntu') assert result == 'ubuntu' + def test_get_mint(self): + result = hosts._normalized_distro_name('LinuxMint') + assert result == 'ubuntu' + def test_get_suse(self): result = hosts._normalized_distro_name('SUSE LINUX') assert result == 'suse' @@ -399,3 +403,7 @@ class TestGetDistro(object): def test_get_fallback(self): result = hosts._get_distro('Solaris', 'Debian') assert result.__name__.endswith('debian') + + def test_get_mint(self): + result = hosts._get_distro('LinuxMint') + assert result.__name__.endswith('debian') -- 2.47.3