live-artifacts: read os name from /usr/lib/os-release

With importing ociarchive, the treefile.json doesn't contain osname.
This commit is contained in:
Bipin B Narayan 2025-07-14 19:43:12 +05:30 committed by Simon de Vlieger
parent 49ee5fca02
commit 7593b65dc7

View file

@ -131,10 +131,8 @@ def make_stream_hash(src, dest):
def get_os_name(tree):
file = os.path.join(tree, 'usr/share/rpm-ostree/treefile.json')
with open(file, encoding='utf8') as f:
treefile = json.load(f)
return treefile['metadata']['name']
os_release = osrelease.parse_files(os.path.join(tree, 'usr', 'lib', 'os-release'))
return f"{os_release['ID']}-{os_release['VARIANT_ID']}"
def ensure_glob(pathname, n="", **kwargs):