From: Sebastian Wagner Date: Thu, 16 Dec 2021 16:51:07 +0000 (+0100) Subject: mgr/cephadm: SNMP: Don't write default values into the store X-Git-Tag: v16.2.8~259^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a45bff5f3d42e89126f8124f584c0862cc5db548;p=ceph.git mgr/cephadm: SNMP: Don't write default values into the store Enable us to chage defaults in the future Signed-off-by: Sebastian Wagner (cherry picked from commit 5e3cc4d6c167b7d5bdd0f08aa90ed7e7d0779b25) --- diff --git a/src/pybind/mgr/cephadm/tests/test_spec.py b/src/pybind/mgr/cephadm/tests/test_spec.py index 2b113dfd98e1..07937f99336b 100644 --- a/src/pybind/mgr/cephadm/tests/test_spec.py +++ b/src/pybind/mgr/cephadm/tests/test_spec.py @@ -672,7 +672,6 @@ placement: spec: credentials: snmp_community: public -port: 9464 snmp_destination: 192.168.1.42:162 snmp_version: V4 """), 'snmp_version unsupported. Must be one of V2c, V3'), diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 4176a7adeeed..47c47f82dfed 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1163,7 +1163,7 @@ Usage: def _apply_snmp_gateway(self, snmp_version: SNMPGatewaySpec.SNMPVersion, destination: str, - port: int = 9464, + port: Optional[int] = None, engine_id: Optional[str] = None, auth_protocol: Optional[SNMPGatewaySpec.SNMPAuthType] = None, privacy_protocol: Optional[SNMPGatewaySpec.SNMPPrivacyType] = None, diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index fea2ec766fea..418e250aad5c 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -1174,7 +1174,7 @@ class SNMPGatewaySpec(ServiceSpec): placement: Optional[PlacementSpec] = None, unmanaged: bool = False, preview_only: bool = False, - port: int = 9464, + port: Optional[int] = None, ): assert service_type == 'snmp-gateway' @@ -1214,7 +1214,7 @@ class SNMPGatewaySpec(ServiceSpec): @property def ports(self) -> List[int]: - return [self.port] + return [self.port or 9464] def get_port_start(self) -> List[int]: return self.ports