]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
packaging.GitbuilderProject: allow more spec from config
authorDan Mick <dan.mick@redhat.com>
Wed, 1 Jun 2016 21:01:44 +0000 (14:01 -0700)
committerDan Mick <dan.mick@redhat.com>
Thu, 23 Jun 2016 21:14:42 +0000 (14:14 -0700)
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 <dan.mick@redhat.com>
teuthology/packaging.py

index b62f295154f0881377ae9779b34fdbcd22992fec..03b9ba1f342cd142d2b7b63b024a048e3377569a 100644 (file)
@@ -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):