]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Removed downburst config support in get_distro and get_distro_version
authorAndrew Schoen <aschoen@redhat.com>
Wed, 28 Jan 2015 16:12:06 +0000 (10:12 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 29 Jan 2015 17:30:32 +0000 (11:30 -0600)
We believe that nobody is using custom downburst configs anymore so
we're planning to deprecate this feature.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
teuthology/misc.py
teuthology/test/test_get_distro.py
teuthology/test/test_get_distro_version.py

index 06b75c1a39f32bdf3cd8b4e2ce82a12de9bc76bb..109b1bea3cc4b911eb752afac295c6081987f513 100644 (file)
@@ -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):
index 862ea07b2046093d8d1e91b31859313afa08fd2f..9c9990306dfedbfb702f7ee1e7adc8dc981902f8 100644 (file)
@@ -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
index 75845ad7a6a3cb35a7410ca12121896905a6b352..fdccc8427936ec2e01e0f795983386b9cfa6940a 100644 (file)
@@ -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'