From 1fcacd6b20838968438b05d4cbb832f8c2c97a07 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 27 Sep 2023 18:12:48 -0400 Subject: [PATCH] cephadm: convert nvmeof type to a ContainerDaemonForm Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 5582e1ef692..7511b4cf17c 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -928,7 +928,7 @@ done @register_daemon_form -class CephNvmeof(DaemonForm): +class CephNvmeof(ContainerDaemonForm): """Defines a Ceph-Nvmeof container""" daemon_type = 'nvmeof' @@ -1061,6 +1061,17 @@ class CephNvmeof(DaemonForm): 'vm.nr_hugepages = 4096', ] + def container(self, ctx: CephadmContext) -> CephContainer: + return get_deployment_container(ctx, self.identity) + + def uid_gid(self, ctx: CephadmContext) -> Tuple[int, int]: + return 167, 167 # TODO: need to get properly the uid/gid + + def config_and_keyring( + self, ctx: CephadmContext + ) -> Tuple[Optional[str], Optional[str]]: + return get_config_and_keyring(ctx) + ################################## @@ -5209,21 +5220,6 @@ def _dispatch_deploy( deployment_type=deployment_type, endpoints=daemon_endpoints ) - elif daemon_type == CephNvmeof.daemon_type: - config, keyring = get_config_and_keyring(ctx) - uid, gid = 167, 167 # TODO: need to get properly the uid/gid - c = get_deployment_container(ctx, ident) - deploy_daemon( - ctx, - ident, - c, - uid, - gid, - config=config, - keyring=keyring, - deployment_type=deployment_type, - endpoints=daemon_endpoints, - ) elif daemon_type == CephadmAgent.daemon_type: # get current user gid and uid -- 2.39.5