From: Andrew Schoen Date: Fri, 31 Jul 2015 21:14:33 +0000 (-0500) Subject: use packaging.DEFAULT_OS_VERSION in teuthology.misc X-Git-Tag: 1.1.0~857^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F580%2Fhead;p=teuthology.git use packaging.DEFAULT_OS_VERSION in teuthology.misc No need to keep two copies of this data around Signed-off-by: Andrew Schoen --- diff --git a/teuthology/misc.py b/teuthology/misc.py index 5ae39425c..7dbb0e3d1 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -28,6 +28,7 @@ from teuthology.exceptions import (CommandCrashedError, CommandFailedError, from .orchestra import run from .config import config from .contextutil import safe_while +from .packaging import DEFAULT_OS_VERSION log = logging.getLogger(__name__) @@ -1236,22 +1237,13 @@ def get_distro_version(ctx): """ Get the verstion of the distro that we are using (release number). """ - default_os_version = dict( - ubuntu="14.04", - fedora="20", - centos="7.0", - opensuse="12.2", - sles="11-sp2", - rhel="7.0", - debian='7.0' - ) distro = get_distro(ctx) if ctx.os_version is not None: return ctx.os_version try: - os_version = ctx.config.get('os_version', default_os_version[distro]) + os_version = ctx.config.get('os_version', DEFAULT_OS_VERSION[distro]) except AttributeError: - os_version = default_os_version[distro] + os_version = DEFAULT_OS_VERSION[distro] return os_version