diff options
author | John Mulligan <jmulligan@redhat.com> | 2023-09-23 21:28:40 +0200 |
---|---|---|
committer | John Mulligan <jmulligan@redhat.com> | 2023-10-04 21:17:57 +0200 |
commit | e82baf51beee4b4713cc74babd552d6bd3e92662 (patch) | |
tree | e319b05937717b79feb5cf3e23571e11c9887a9e | |
parent | cephadm: convert CustomContainer to a ContainerDaemonForm (diff) | |
download | ceph-e82baf51beee4b4713cc74babd552d6bd3e92662.tar.xz ceph-e82baf51beee4b4713cc74babd552d6bd3e92662.zip |
cephadm: convert SNMPGateway to a ContainerDaemonForm
Signed-off-by: John Mulligan <jmulligan@redhat.com>
-rwxr-xr-x | src/cephadm/cephadm.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 97419dded0b..8869881de42 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -262,7 +262,7 @@ class OSD(Ceph): @register_daemon_form -class SNMPGateway(DaemonForm): +class SNMPGateway(ContainerDaemonForm): """Defines an SNMP gateway between Prometheus and SNMP monitoring Frameworks""" daemon_type = 'snmp-gateway' SUPPORTED_VERSIONS = ['V2c', 'V3'] @@ -414,6 +414,12 @@ class SNMPGateway(DaemonForm): if not self.destination: raise Error('config is missing destination attribute(<ip>:<port>) of the target SNMP listener') + def container(self, ctx: CephadmContext) -> CephContainer: + return get_deployment_container(ctx, self.identity) + + def uid_gid(self, ctx: CephadmContext) -> Tuple[int, int]: + return self.uid, self.gid + ################################## @register_daemon_form @@ -5241,18 +5247,6 @@ def _dispatch_deploy( endpoints=daemon_endpoints, ) - elif daemon_type == SNMPGateway.daemon_type: - sc = SNMPGateway.init(ctx, ident.fsid, ident.daemon_id) - c = get_deployment_container(ctx, ident) - deploy_daemon( - ctx, - ident, - c, - sc.uid, - sc.gid, - deployment_type=deployment_type, - endpoints=daemon_endpoints, - ) else: try: _deploy_daemon_container( |