Update from upstream #11

Closed
soksanichenko wants to merge 158 commits from a8_updated into a8
2 changed files with 40 additions and 0 deletions
Showing only changes of commit 0530cf2712 - Show all commits

View File

@ -147,6 +147,15 @@ class OSBSThread(WorkerThread):
raise RuntimeError(
"There is no variant %s to get repo from to pass to OSBS." % repo
)
cts_url = compose.conf.get("cts_url", None)
if cts_url:
return os.path.join(
cts_url,
"api/1/composes",
compose.compose_id,
"repo/?variant=%s" % variant,
)
repo_path = compose.paths.compose.repository(
"$basearch", variant, create_dir=False
)

View File

@ -364,6 +364,37 @@ class OSBSThreadTest(helpers.PungiTestCase):
) as f:
self.assertIn("baseurl=http://example.com/repo\n", f)
@mock.patch("pungi.phases.osbs.kojiwrapper.KojiWrapper")
def test_run_with_extra_repos_with_cts(self, KojiWrapper):
cfg = {
"url": "git://example.com/repo?#BEEFCAFE",
"target": "f24-docker-candidate",
"git_branch": "f24-docker",
"name": "my-name",
"version": "1.0",
"repo": [
"Everything",
],
}
self.compose.conf["cts_url"] = "http://cts.localhost"
self._setupMock(KojiWrapper)
self._assertConfigCorrect(cfg)
self.t.process((self.compose, self.compose.variants["Server"], cfg), 1)
cts_url = "http://cts.localhost/api/1/composes/%s" % self.compose.compose_id
options = {
"name": "my-name",
"version": "1.0",
"git_branch": "f24-docker",
"yum_repourls": [
"%s/repo/?variant=Server" % cts_url,
"%s/repo/?variant=Everything" % cts_url,
],
}
self._assertCorrectCalls(options)
self._assertCorrectMetadata()
@mock.patch("pungi.phases.osbs.kojiwrapper.KojiWrapper")
def test_run_with_deprecated_registry(self, KojiWrapper):
cfg = {