From abf39a669f04b130b248c2edc0e7102bbb61b2ec Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 27 Sep 2023 18:15:37 -0400 Subject: [PATCH] cephadm: convert iscsi type to a ContainerDaemonForm Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 7511b4cf17c..6faf348a7fd 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -728,7 +728,7 @@ class NFSGanesha(ContainerDaemonForm): @register_daemon_form -class CephIscsi(DaemonForm): +class CephIscsi(ContainerDaemonForm): """Defines a Ceph-Iscsi container""" daemon_type = 'iscsi' @@ -923,6 +923,17 @@ done tcmu_container.cname = self.get_container_name(desc='tcmu') return tcmu_container + def container(self, ctx: CephadmContext) -> CephContainer: + return get_deployment_container(ctx, self.identity) + + def config_and_keyring( + self, ctx: CephadmContext + ) -> Tuple[Optional[str], Optional[str]]: + return get_config_and_keyring(ctx) + + def uid_gid(self, ctx: CephadmContext) -> Tuple[int, int]: + return extract_uid_gid(ctx) + ################################## @@ -5205,22 +5216,6 @@ def _dispatch_deploy( endpoints=daemon_endpoints ) - elif daemon_type == CephIscsi.daemon_type: - config, keyring = get_config_and_keyring(ctx) - uid, gid = extract_uid_gid(ctx) - 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 uid = os.getuid() -- 2.39.5