From: Alfredo Deza Date: Wed, 30 Oct 2013 23:25:34 +0000 (-0400) Subject: map major versions of Debian to releases X-Git-Tag: v1.3~2^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a798fa21b7418c7fc9f0cf0de4cc70140afd7d26;p=ceph-deploy.git map major versions of Debian to releases Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/__init__.py b/ceph_deploy/hosts/__init__.py index 7778bed..a834243 100644 --- a/ceph_deploy/hosts/__init__.py +++ b/ceph_deploy/hosts/__init__.py @@ -36,6 +36,9 @@ def get(hostname, username=None, fallback=None): ) conn.import_module(remotes) distro_name, release, codename = conn.remote_module.platform_information() + if not codename: + raise exc.UnsupportedPlatform(distro=distro, codename=codename) + machine_type = conn.remote_module.machine_type() module = _get_distro(distro_name) diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index b556fbe..98d4d31 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -8,6 +8,15 @@ import platform def platform_information(): """ detect platform information from remote host """ distro, release, codename = platform.linux_distribution() + if not codename: # this could be an empty string in Debian + debian_codenames = { + '8': 'jessie', + '7': 'wheezy', + '6': 'squeeze', + } + major_version = release.split('.')[0] + codename = debian_codenames.get(major_version, '') + return ( str(distro).rstrip(), str(release).rstrip(),