From ec190e65d1d7a4f0e377b2d92ab371a8ec1c9a60 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Wed, 1 Jun 2016 14:01:44 -0700 Subject: [PATCH] packaging.GitbuilderProject: allow more spec from config To use GbP as a build-checking resource, allow more values to come from config rather than hardcoding or deriving. Signed-off-by: Dan Mick --- teuthology/packaging.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/teuthology/packaging.py b/teuthology/packaging.py index b62f295154..03b9ba1f34 100644 --- a/teuthology/packaging.py +++ b/teuthology/packaging.py @@ -470,21 +470,27 @@ class GitbuilderProject(object): """ self.arch = self.job_config.get('arch', 'x86_64') self.os_type = self.job_config.get("os_type") + self.flavor = self.job_config.get("flavor") + self.codename = self.job_config.get("codename") self.os_version = self._get_version() + self.ref = self.job_config.get("ref") self.distro = self._get_distro( distro=self.os_type, version=self.os_version, + codename=self.codename, ) self.pkg_type = "deb" if self.os_type.lower() in ( "ubuntu", "debian", ) else "rpm" - # avoiding circular imports - from teuthology.suite.util import get_install_task_flavor - # when we're initializing from a full teuthology config, not just a - # task config we need to make sure we're looking at the flavor for - # the install task - self.flavor = get_install_task_flavor(self.job_config) + + if not getattr(self, 'flavor'): + # avoiding circular imports + from teuthology.suite.util import get_install_task_flavor + # when we're initializing from a full teuthology config, not just a + # task config we need to make sure we're looking at the flavor for + # the install task + self.flavor = get_install_task_flavor(self.job_config) @property def sha1(self): @@ -648,7 +654,7 @@ class GitbuilderProject(object): else: # FIXME: Should master be the default? log.debug("defaulting to master branch") - uri = 'ref/master' + uri = getattr(self, 'ref', 'ref/master') return uri def _get_base_url(self): -- 2.39.5