From 18b8c53f8f78864e52dc3c836baba292793994f2 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Fri, 31 Jul 2015 16:14:33 -0500 Subject: [PATCH] use packaging.DEFAULT_OS_VERSION in teuthology.misc No need to keep two copies of this data around Signed-off-by: Andrew Schoen --- teuthology/misc.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index 5ae39425c2..7dbb0e3d10 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 -- 2.39.5