]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
map major versions of Debian to releases
authorAlfredo Deza <alfredo.deza@inktank.com>
Wed, 30 Oct 2013 23:25:34 +0000 (19:25 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Wed, 30 Oct 2013 23:25:34 +0000 (19:25 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/hosts/__init__.py
ceph_deploy/hosts/remotes.py

index 7778bede919d7caab57b7eea20ef76f77e41ff54..a834243857280c36369f1060c4acc2a0a0ef1c02 100644 (file)
@@ -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)
index b556fbe7d44ed3cbbf69c28897167e54ee11a981..98d4d3197a8f78d883badbfe60c5271e71e59e6f 100644 (file)
@@ -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(),