Stop failing when old updateinfo doesn't exist

This commit is contained in:
Mustafa Gezen 2023-02-04 10:27:13 +01:00
parent 383f28f714
commit 5c60d387d8
Signed by untrusted user who does not match committer: mustafa
GPG Key ID: DCDF010D946438C1

View File

@ -285,8 +285,9 @@ async def update_repomd_xml(repomd_xml_path: str, updateinfo: dict):
f.write(xml_str)
# Delete old updateinfo file if not the same as the new one
if existing_updateinfo_path:
updinfo_base = os.path.basename(existing_updateinfo_path)
if existing_updateinfo_path and updinfo_base != updateinfo_path:
if updinfo_base != updateinfo_path:
try:
logger.info("Deleting %s", existing_updateinfo_path)
os.remove(existing_updateinfo_path)