Skip to content

Commit ba863fd

Browse files
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 <[email protected]>
1 parent 4884654 commit ba863fd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cephadm/cephadm.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
CEPH_DEFAULT_PUBKEY,
6060
CEPH_KEYRING,
6161
CEPH_PUBKEY,
62-
CGROUPS_SPLIT_PODMAN_VERSION,
6362
CONTAINER_INIT,
6463
CUSTOM_PS1,
6564
DATA_DIR,
@@ -2814,7 +2813,7 @@ def get_container(
28142813
'--cidfile',
28152814
f'{runtime_dir}/{service_name}-cid',
28162815
])
2817-
if ctx.container_engine.version >= CGROUPS_SPLIT_PODMAN_VERSION and not ctx.no_cgroups_split:
2816+
if ctx.container_engine.supports_split_cgroups and not ctx.no_cgroups_split:
28182817
container_args.append('--cgroups=split')
28192818
# if /etc/hosts doesn't exist, we can be confident
28202819
# users aren't using it for host name resolution
@@ -3406,7 +3405,7 @@ def get_unit_file(ctx, fsid):
34063405
'ExecStopPost=-/bin/rm -f %t/%n-pid %t/%n-cid\n'
34073406
'Type=forking\n'
34083407
'PIDFile=%t/%n-pid\n')
3409-
if ctx.container_engine.version >= CGROUPS_SPLIT_PODMAN_VERSION:
3408+
if ctx.container_engine.supports_split_cgroups:
34103409
extra_args += 'Delegate=yes\n'
34113410

34123411
docker = isinstance(ctx.container_engine, Docker)

0 commit comments

Comments
 (0)