From 8225382b290d52bacf88e1b35e0deefe5187dfd6 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Tue, 4 Aug 2015 09:24:07 -0500 Subject: [PATCH] packaging: ignore minor version numbers in gitbuilder urls We don't care about minor version numbers anymore for gitbuilder. Signed-off-by: Andrew Schoen --- teuthology/packaging.py | 15 ++------------- teuthology/test/test_packaging.py | 4 +++- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/teuthology/packaging.py b/teuthology/packaging.py index 38a7899c0..4723bd370 100644 --- a/teuthology/packaging.py +++ b/teuthology/packaging.py @@ -521,20 +521,9 @@ class GitbuilderProject(object): 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 an - underscore as the separator instead of a period. + Minor version numbers are ignored. """ - version_tokens = version.split(".") - include_minor_version = ( - len(version_tokens) > 1 and - version_tokens[1] != "0" - ) - if include_minor_version: - return "_".join(version_tokens) - - # return only the major version - return version_tokens[0] + return version.split(".")[0] def _get_distro(self, distro=None, version=None, codename=None): """ diff --git a/teuthology/test/test_packaging.py b/teuthology/test/test_packaging.py index 65f95987b..08c42a922 100644 --- a/teuthology/test/test_packaging.py +++ b/teuthology/test/test_packaging.py @@ -352,7 +352,9 @@ class TestGitbuilderProject(object): GITBUILDER_DISTRO_MATRIX = [ ('rhel', '7.0', None, 'centos7'), - ('centos', '6.5', None, 'centos6_5'), + ('centos', '6.5', None, 'centos6'), + ('centos', '7.0', None, 'centos7'), + ('centos', '7.1', None, 'centos7'), ('fedora', '20', None, 'fc20'), ('ubuntu', '14.04', 'trusty', 'trusty'), ('ubuntu', '14.04', None, 'trusty'), -- 2.47.3