From 009a6dafdb3f4014000c1e5eee6ab46d75e1db3f Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Wed, 28 Jan 2015 10:12:06 -0600 Subject: [PATCH] Removed downburst config support in get_distro and get_distro_version We believe that nobody is using custom downburst configs anymore so we're planning to deprecate this feature. Signed-off-by: Andrew Schoen --- teuthology/misc.py | 23 +++++----------------- teuthology/test/test_get_distro.py | 5 ----- teuthology/test/test_get_distro_version.py | 15 +++++--------- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index 06b75c1a3..109b1bea3 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -1154,26 +1154,16 @@ def get_distro(ctx): """ Get the name of the distro that we are using (usually the os_type). """ - os_type = None + # ubuntu is our default distro choice + os_type = "ubuntu" if ctx.os_type: return ctx.os_type try: - os_type = ctx.config.get('os_type', None) + os_type = ctx.config.get('os_type', os_type) except AttributeError: pass - # next, look for an override in the downburst config for os_type - # FIXME: checking the downburst config for distro shouldn't be needed - # as it's only used in provision.create_if_vm and that function performs - # this check again while building the config for downburst. Leaving it - # here for now until we can fully investigate and test it's removal. - try: - os_type = ctx.config['downburst'].get('distro', os_type) - except (KeyError, AttributeError): - pass - if os_type is None: - # default to ubuntu if we can't find the os_type anywhere else - return "ubuntu" + return os_type @@ -1197,10 +1187,7 @@ def get_distro_version(ctx): os_version = ctx.config.get('os_version', default_os_version[distro]) except AttributeError: os_version = default_os_version[distro] - try: - return ctx.config['downburst'].get('distroversion', os_version) - except (KeyError, AttributeError): - return os_version + return os_version def get_multi_machine_types(machinetype): diff --git a/teuthology/test/test_get_distro.py b/teuthology/test/test_get_distro.py index 862ea07b2..9c9990306 100644 --- a/teuthology/test/test_get_distro.py +++ b/teuthology/test/test_get_distro.py @@ -35,11 +35,6 @@ class TestGetDistro(object): distro = get_distro(self.fake_ctx) assert distro == 'centos' - def test_teuth_config_downburst(self): - self.fake_ctx.config = {'downburst' : {'distro': 'sles'}} - distro = get_distro(self.fake_ctx) - assert distro == 'sles' - def test_no_config_or_os_type(self): self.fake_ctx = Mock() self.fake_ctx.os_type = None diff --git a/teuthology/test/test_get_distro_version.py b/teuthology/test/test_get_distro_version.py index 75845ad7a..fdccc8427 100644 --- a/teuthology/test/test_get_distro_version.py +++ b/teuthology/test/test_get_distro_version.py @@ -34,19 +34,14 @@ class TestGetDistroVersion(object): distroversion = get_distro_version(self.fake_ctx) assert distroversion == '13.04' - def test_teuth_config_downburst_version(self): - #Argument takes precidence - self.fake_ctx.os_version = '13.10' - self.fake_ctx.config = {'downburst' : {'distroversion': '13.04'}} - distroversion = get_distro_version(self.fake_ctx) - assert distroversion == '13.10' - def test_teuth_config_noarg_version(self): self.fake_ctx_noarg.config = {'os_version': '13.04'} distroversion = get_distro_version(self.fake_ctx_noarg) assert distroversion == '13.04' - def test_teuth_config_downburst_noarg_version(self): - self.fake_ctx_noarg.config = {'downburst' : {'distroversion': '13.04'}} - distroversion = get_distro_version(self.fake_ctx_noarg) + def test_no_teuth_config(self): + self.fake_ctx = Mock() + self.fake_ctx.os_type = None + self.fake_ctx.os_version = '13.04' + distroversion = get_distro_version(self.fake_ctx) assert distroversion == '13.04' -- 2.47.3