Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Merge 87fda4e into 58a754b
Browse files Browse the repository at this point in the history
  • Loading branch information
csomh committed Jun 18, 2019
2 parents 58a754b + 87fda4e commit 0fabe65
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/integration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class Koji:
"""
def __init__(self, kojihub, kojiroot):
self._kojihub = kojihub
self._kojiroot = kojiroot
self._pathinfo = koji.PathInfo(kojiroot)
self._session = koji.ClientSession(self._kojihub)

def download_manifest(self, nvr, tmpdir):
Expand All @@ -417,11 +417,19 @@ def download_manifest(self, nvr, tmpdir):
Raises: HTTPError, in case the downloading the archive failed.
"""
for log in self._session.getBuildLogs(nvr):
build = self._session.getBuild(nvr)
# TODO(csomh): this is the 'old' way of storing the manifests. Remove it
# once OMPS drops support for it.
for log in self._session.getBuildLogs(build):
if log['name'] == 'operator_manifests.zip':
path = log['path']
file_url = f"{self._pathinfo.topdir}/{log['path']}"
break
else:
btype = "operator-manifests"
archives = self._session.listArchives(buildID=build["id"], type=btype)
if archives:
file_url = f"{self._pathinfo.typedir(build, btype)}/{archives[0]['filename']}"

file_url = '{root}/{path}'.format(root=self._kojiroot, path=path)
r = requests.get(file_url)
r.raise_for_status()

Expand Down

0 comments on commit 0fabe65

Please sign in to comment.