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: v17.1.0~130^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5e3cc4d6c167b7d5bdd0f08aa90ed7e7d0779b25;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 --- diff --git a/src/pybind/mgr/cephadm/tests/test_spec.py b/src/pybind/mgr/cephadm/tests/test_spec.py index 155641855ce4..f92c6ac10b28 100644 --- a/src/pybind/mgr/cephadm/tests/test_spec.py +++ b/src/pybind/mgr/cephadm/tests/test_spec.py @@ -660,7 +660,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 9c252a35887c..c028189e0e9c 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1153,7 +1153,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 d45a460c9049..8b95844bfea4 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -1186,7 +1186,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' @@ -1226,7 +1226,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