]> 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>
Wed, 5 Jan 2022 09:23:04 +0000 (10:23 +0100)
Enable us to chage defaults in the future

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
src/pybind/mgr/cephadm/tests/test_spec.py
src/pybind/mgr/orchestrator/module.py
src/python-common/ceph/deployment/service_spec.py

index 155641855ce478d5d247111a045e6970a7474187..f92c6ac10b28cbcc109ccc68e222471988ea9307 100644 (file)
@@ -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'),
index 9c252a35887cdc31d7762c9d20f12f5b185f7f7a..c028189e0e9c78b91a8f7ca2676f6add9422251d 100644 (file)
@@ -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,
index d45a460c904954f93f5681235025567eec338e8b..8b95844bfea41b4ab6e4aa58389ddd678a517988 100644 (file)
@@ -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