Skip to content

Commit

Permalink
Look for images and sbom assets also in the iso/ folder
Browse files Browse the repository at this point in the history
After the latest changes of product-composer (allowing to build isos with different
names than ftp trees), the sbom assets are no longer saved in the root of the repo
(as they are for SLFO 1.0) and now live in the iso folder as well.

So look for those assets in both places.
  • Loading branch information
boiko committed Dec 13, 2024
1 parent 17af565 commit 952ad8a
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 952ad8a

Please sign in to comment.