Skip to content

Commit

Permalink
fix latest_fedora retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Apr 25, 2024
1 parent 5cb331e commit e428ca0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kvirt/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ def get_latest_rhcos_metal(url):
def get_latest_fedora(arch='x86_64'):
request = Request('https://fedoraproject.org/cloud/download/_payload.json', headers={'Accept': 'application/json'})
for entry in json.loads(urlopen(request).read()):
if isinstance(entry, str) and entry.startswith('Cloud') and f'{arch}.qcow2' in entry:
if isinstance(entry, str) and entry.startswith('Cloud') and arch in entry and 'qcow2' in entry:
short = os.path.basename(entry)
major = short.replace('Fedora-Cloud-Base-', '').split('-')[0]
return f"https://download.fedoraproject.org/pub/fedora/linux/releases/{major}/Cloud/{arch}/images/{short}"
Expand Down

0 comments on commit e428ca0

Please sign in to comment.