From ba863fd61e9dc0eb4b0bc37d8c7acf263f83abc1 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 14 Oct 2023 11:21:05 -0400 Subject: [PATCH] cephadm: change version checks to use supports_split_cgroups method Use the recently added supports_split_cgroups method instead of checking for an exact version. Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index a64b0b49404..622b8aa4157 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -59,7 +59,6 @@ from cephadmlib.constants import ( CEPH_DEFAULT_PUBKEY, CEPH_KEYRING, CEPH_PUBKEY, - CGROUPS_SPLIT_PODMAN_VERSION, CONTAINER_INIT, CUSTOM_PS1, DATA_DIR, @@ -2814,7 +2813,7 @@ def get_container( '--cidfile', f'{runtime_dir}/{service_name}-cid', ]) - if ctx.container_engine.version >= CGROUPS_SPLIT_PODMAN_VERSION and not ctx.no_cgroups_split: + if ctx.container_engine.supports_split_cgroups and not ctx.no_cgroups_split: container_args.append('--cgroups=split') # if /etc/hosts doesn't exist, we can be confident # users aren't using it for host name resolution @@ -3406,7 +3405,7 @@ def get_unit_file(ctx, fsid): 'ExecStopPost=-/bin/rm -f %t/%n-pid %t/%n-cid\n' 'Type=forking\n' 'PIDFile=%t/%n-pid\n') - if ctx.container_engine.version >= CGROUPS_SPLIT_PODMAN_VERSION: + if ctx.container_engine.supports_split_cgroups: extra_args += 'Delegate=yes\n' docker = isinstance(ctx.container_engine, Docker) -- 2.47.3