]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
install: ignore minor version when building a gitbuilder url 588/head
authorAndrew Schoen <aschoen@redhat.com>
Tue, 4 Aug 2015 17:12:49 +0000 (12:12 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 4 Aug 2015 17:12:49 +0000 (12:12 -0500)
We don't care about minor version in gitbuilder anymore.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
teuthology/task/install.py
teuthology/test/task/test_install.py

index 2353913ccc217c69cdb43df5cb871437ca2a57b9..8c210b73c1614e9d6e2bb1245ef6dc9bfcd1088c 100644 (file)
@@ -171,20 +171,10 @@ def _get_gitbuilder_version(version):
     Parses a distro version string and returns a modified string
     that matches the format needed for the gitbuilder url.
 
-    Minor version numbers are ignored if they end in a zero. If they do
-    not end in a zero the minor version number is included with a dash as
-    the separator instead of a period.
-    """
-    version_tokens = version.split(".")
-    include_minor_version = (
-        len(version_tokens) > 1 and
-        version_tokens[1] != "0"
-    )
-    if include_minor_version:
-        return "_".join(version_tokens)
-
+    Minor version numbers are ignored.
+    """
     # return only the major version
-    return version_tokens[0]
+    return version.split(".")[0]
 
 
 def _get_baseurl(ctx, remote, config):
index 2fc5150b2ce9fa7f661bb8b0e668e3b667ce56bd..21bf6eed95bb2c8aa5ae1e3dbeb6c0ca012dac6a 100644 (file)
@@ -107,11 +107,11 @@ class TestInstall(object):
         m_get_config_value_for_remote.return_value = "tag"
         result = install._get_baseurlinfo_and_dist(Mock(), remote, dict())
         expected = dict(
-            dist="centos6_5",
+            dist="centos6",
             arch="x86_64",
             flavor="basic",
             uri="ref/tag",
-            dist_release="el6_5",
+            dist_release="el6",
         )
         assert result == expected