From b4a6eb344659caf3a149db6050a7ddac4e27195d Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Jul 07 2017 06:20:09 +0000 Subject: Allow to pass repo URLs to yum_repourls of buildContainer Signed-off-by: Chenxiong Qi --- diff --git a/freshmaker/handlers/__init__.py b/freshmaker/handlers/__init__.py index e995ca0..5caaaf7 100644 --- a/freshmaker/handlers/__init__.py +++ b/freshmaker/handlers/__init__.py @@ -65,7 +65,8 @@ class BaseHandler(object): mbs = MBS(conf) return mbs.build_module(name, branch, rev) - def build_container(self, name, branch, rev, namespace='container'): + def build_container(self, name, branch, rev, + namespace='container', repo_urls=None): """ Build a container in Koji. @@ -93,6 +94,7 @@ class BaseHandler(object): return service.build_container(build_source, branch, + repo_urls=repo_urls, namespace=namespace, scratch=conf.koji_container_scratch_build) diff --git a/freshmaker/kojiservice.py b/freshmaker/kojiservice.py index a08ab84..fcee9fe 100644 --- a/freshmaker/kojiservice.py +++ b/freshmaker/kojiservice.py @@ -70,7 +70,8 @@ class KojiService(object): def logout(self): self.session.logout() - def build_container(self, source_url, branch, namespace=None, scratch=None): + def build_container(self, source_url, branch, + namespace=None, scratch=None, repo_urls=None): """Build container by buildContainer""" build_target = '{}-{}-candidate'.format( @@ -81,6 +82,8 @@ class KojiService(object): 'scratch': False if scratch is None else True, 'git_branch': branch, } + if repo_urls: + build_opts['yum_repourls'] = repo_urls if self._logger: self._logger.debug('Build from target: %s', build_target)