From: Hong Zhiguo Date: Tue, 2 Jun 2015 08:43:15 +0000 (+0800) Subject: support for distro Mint which is based on ubuntu X-Git-Tag: v1.5.26~17^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F307%2Fhead;p=ceph-deploy.git support for distro Mint which is based on ubuntu Signed-off-by: Hong Zhiguo --- 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')