From: John Mulligan Date: Tue, 7 Nov 2023 22:57:43 +0000 (-0500) Subject: cephadm: add more ContainerDeamonForm methods to the snmp class X-Git-Tag: v19.0.0~79^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4022b0738081ca74a5889e100aed68fdd2a0e4b;p=ceph.git cephadm: add more ContainerDeamonForm methods to the snmp class Add methods customize_{container,process}_args to the snmp gateway daemon type class. Use those methods in the get_container function. Signed-off-by: John Mulligan --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index c9bc3a787579..8225553c9271 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -558,6 +558,16 @@ class SNMPGateway(ContainerDaemonForm): def uid_gid(self, ctx: CephadmContext) -> Tuple[int, int]: return self.uid, self.gid + def customize_container_args( + self, ctx: CephadmContext, args: List[str] + ) -> None: + args.append(f'--env-file={self.conf_file_path}') + + def customize_process_args( + self, ctx: CephadmContext, args: List[str] + ) -> None: + args.extend(self.get_daemon_args()) + ################################## @register_daemon_form @@ -2896,11 +2906,9 @@ def get_container( binds = get_container_binds(ctx, ident) mounts = get_container_mounts(ctx, ident) elif daemon_type == SNMPGateway.daemon_type: - sg = SNMPGateway.init(ctx, ident.fsid, ident.daemon_id) - container_args.append( - f'--env-file={sg.conf_file_path}' - ) - d_args.extend(sg.get_daemon_args()) + sg = SNMPGateway.create(ctx, ident) + sg.customize_container_args(ctx, container_args) + sg.customize_process_args(ctx, d_args) _update_container_args_for_podman(ctx, ident, container_args) return CephContainer.for_daemon(