1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-07 05:38:43 +02:00

Fix a crash in 'Fix handling empty vm_type in Store.last_buildroot' when last_buildroot is empty

This commit is contained in:
2023-09-25 14:41:17 +02:00
parent 641b365f38
commit ee725ff51b
2 changed files with 8 additions and 1 deletions

View File

@@ -288,11 +288,16 @@ class Store:
def last_buildroot(self):
self.assert_is_package()
items = self.read_list("_last_buildroot")
if items is not None and len(items) != 3:
if items is None:
return items
if len(items) != 3:
msg = f"Package '{self.path}' contains _last_buildroot metadata that doesn't contain 3 lines: [repo, arch, vm_type]"
raise oscerr.NoWorkingCopy(msg)
if items[2] in ("", "None"):
items[2] = None
return items
@last_buildroot.setter