From f373017f23924ed296a5f554fa5569295322840b Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Tue, 4 Aug 2015 12:12:49 -0500 Subject: [PATCH] install: ignore minor version when building a gitbuilder url We don't care about minor version in gitbuilder anymore. Signed-off-by: Andrew Schoen --- teuthology/task/install.py | 16 +++------------- teuthology/test/task/test_install.py | 4 ++-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/teuthology/task/install.py b/teuthology/task/install.py index 2353913ccc..8c210b73c1 100644 --- a/teuthology/task/install.py +++ b/teuthology/task/install.py @@ -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): diff --git a/teuthology/test/task/test_install.py b/teuthology/test/task/test_install.py index 2fc5150b2c..21bf6eed95 100644 --- a/teuthology/test/task/test_install.py +++ b/teuthology/test/task/test_install.py @@ -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 -- 2.39.5