Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions ceph_devstack/requirements.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import shlex

from pathlib import Path
from packaging.version import parse as parse_version, Version
from typing import List

Expand Down Expand Up @@ -161,7 +160,9 @@ async def check(self):
return True


class PodmanRuntime(Requirement):
class PodmanRuntime(FixableRequirement):
suggest_msg = "Could not find the 'crun' container runtime"

@property
def fix_cmd(self):
if self.host.os_type != "darwin":
Expand All @@ -170,19 +171,8 @@ def fix_cmd(self):

async def check(self):
podman_info = await self.host.podman_info()
storage_conf_path = podman_info["store"]["configFile"]
runtime = podman_info["host"]["ociRuntime"]["name"]
if runtime == "crun":
return True
else:
containers_conf_path = Path(storage_conf_path).parent / "containers.conf"
cmd = host.cmd(["podman", "system", "reset"])
logger.error(
f"The configured runtime is '{runtime}'. "
f"It must be set to 'crun' in {containers_conf_path}. "
f"Afterward, run '{cmd}'."
)
return False
return runtime == "crun"


class SELinuxBoolean(FixableRequirement):
Expand Down
Loading