]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: SNMP: Don't write default values into the store
authorSebastian Wagner <sewagner@redhat.com>
Thu, 16 Dec 2021 16:51:07 +0000 (17:51 +0100)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 18 Jan 2022 10:45:23 +0000 (11:45 +0100)
Enable us to chage defaults in the future

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 5e3cc4d6c167b7d5bdd0f08aa90ed7e7d0779b25)

src/pybind/mgr/cephadm/tests/test_spec.py
src/pybind/mgr/orchestrator/module.py
src/python-common/ceph/deployment/service_spec.py

index 2b113dfd98e136a6ef94411bd4ff5e7b9099ce62..07937f99336b5505d84d32cfe7ca638f6554e71e 100644 (file)
@@ -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'),
index 4176a7adeeed51cd77e0c873460e5759773ac13b..47c47f82dfede1cd85c62ff924d015c761999d99 100644 (file)
@@ -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,
index fea2ec766feadd326d15e0c3720595d9a3a36302..418e250aad5cac86119f3888aa5ea034b8cc0395 100644 (file)
@@ -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