meta: new host runner detection logic

This is a port of `pipeline.detect_host_runner` in combination
with the new runner detection logic.
This commit is contained in:
Christian Kellner 2022-03-23 14:37:18 +01:00
parent ec1c5bb37c
commit c755068bd2

View file

@ -34,6 +34,8 @@ from typing import (Any, Deque, Dict, List, Optional, Sequence, Set, Tuple,
import jsonschema
from .util import osrelease
FAILED_TITLE = "JSON Schema validation failed"
FAILED_TYPEURI = "https://osbuild.org/validation-error"
@ -668,3 +670,9 @@ class Index:
# candidate None or is too new for version (2)
raise ValueError(f"No suitable runner for {name}")
def detect_host_runner(self) -> RunnerInfo:
"""Use os-release(5) to detect the runner for the host"""
osname = osrelease.describe_os(*osrelease.DEFAULT_PATHS)
return self.detect_runner("org.osbuild." + osname)