Skip to content

Commit 8317346

Browse files
authored
Merge pull request #45 from ceph/crun-fix
Improve runtime fix
2 parents c884832 + f16dc71 commit 8317346

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

‎ceph_devstack/requirements.py‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import shlex
22

3-
from pathlib import Path
43
from packaging.version import parse as parse_version, Version
54
from typing import List
65

@@ -161,7 +160,9 @@ async def check(self):
161160
return True
162161

163162

164-
class PodmanRuntime(Requirement):
163+
class PodmanRuntime(FixableRequirement):
164+
suggest_msg = "Could not find the 'crun' container runtime"
165+
165166
@property
166167
def fix_cmd(self):
167168
if self.host.os_type != "darwin":
@@ -170,19 +171,8 @@ def fix_cmd(self):
170171

171172
async def check(self):
172173
podman_info = await self.host.podman_info()
173-
storage_conf_path = podman_info["store"]["configFile"]
174174
runtime = podman_info["host"]["ociRuntime"]["name"]
175-
if runtime == "crun":
176-
return True
177-
else:
178-
containers_conf_path = Path(storage_conf_path).parent / "containers.conf"
179-
cmd = host.cmd(["podman", "system", "reset"])
180-
logger.error(
181-
f"The configured runtime is '{runtime}'. "
182-
f"It must be set to 'crun' in {containers_conf_path}. "
183-
f"Afterward, run '{cmd}'."
184-
)
185-
return False
175+
return runtime == "crun"
186176

187177

188178
class SELinuxBoolean(FixableRequirement):

0 commit comments

Comments
 (0)