Skip to content

Commit

Permalink
Merge pull request #3200 from boiko/adjust_rabbit_openqa_for_micro_61
Browse files Browse the repository at this point in the history
Look for images and sbom assets also in the iso/ folder
  • Loading branch information
Vogtinator authored Dec 16, 2024
2 parents 17af565 + 952ad8a commit 9b8e794
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions gocd/rabbit-openqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,24 @@ def map_iso(self, staging_project, iso):
def gather_isos(self, name, repository):
iso_set = set()

# Fetch /published/prj/repo/iso/*.iso
url = self.api.makeurl(['published', name, repository, 'iso'])
f = self.api.retried_GET(url)
root = ET.parse(f).getroot()
for entry in root.findall('entry'):
if entry.get('name').endswith('.iso'):
iso_set.add(self.map_iso(name, entry.get('name')))

# Fetch /published/prj/repo/*.{qcow2,raw.xz,spdx.json}
url = self.api.makeurl(['published', name, repository])
f = self.api.retried_GET(url)
root = ET.parse(f).getroot()
for entry in root.findall('entry'):
filename = entry.get('name')
if (filename.endswith('.qcow2') or
filename.endswith('.raw.xz') or
filename.endswith('.spdx.json')):
iso_set.add(self.map_iso(name, filename))
# Look for .iso and other images/sbom assets in the repository root and in the
# iso sub-folder of /published/prj/repo/
places = (
['published', name, repository, 'iso'],
['published', name, repository],
)
for place in places:
url = self.api.makeurl(place)
f = self.api.retried_GET(url)
root = ET.parse(f).getroot()

for entry in root.findall('entry'):
filename = entry.get('name')
if (filename.endswith('.qcow2') or
filename.endswith('.raw.xz') or
filename.endswith('.spdx.json') or
filename.endswith('.iso')):
iso_set.add(self.map_iso(name, filename))

# Filter out isos which couldn't be mapped
return [iso for iso in iso_set if iso]
Expand Down

0 comments on commit 9b8e794

Please sign in to comment.