]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: set `lsm_data` to default of Dict type
authorMichael Fritch <mfritch@suse.com>
Tue, 13 Oct 2020 00:56:34 +0000 (18:56 -0600)
committerSebastian Wagner <sebastian.wagner@suse.com>
Wed, 18 Nov 2020 10:52:17 +0000 (11:52 +0100)
similar to handling of `sys_api`, convert a NoneType to a Dict

Fixes: https://tracker.ceph.com/issues/47841
Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 39512f9f9aa8ad6f0dab31e249ff563003c0befe)

src/python-common/ceph/deployment/inventory.py

index eb9852426c44cba344eed4c7cdd582b403be111d..e2409c932e991e8d9c1dee424235a7004f28d26a 100644 (file)
@@ -51,7 +51,7 @@ class Device(object):
                  rejected_reasons=None,  # type: Optional[List[str]]
                  lvs=None,  # type: Optional[List[str]]
                  device_id=None,  # type: Optional[str]
-                 lsm_data={},  # type: Dict[str, Dict[str, str]]
+                 lsm_data=None,  # type: Optional[Dict[str, Dict[str, str]]]
                  ):
         self.path = path
         self.sys_api = sys_api if sys_api is not None else {}  # type: Dict[str, Any]
@@ -59,7 +59,7 @@ class Device(object):
         self.rejected_reasons = rejected_reasons if rejected_reasons is not None else []
         self.lvs = lvs
         self.device_id = device_id
-        self.lsm_data = lsm_data
+        self.lsm_data = lsm_data if lsm_data is not None else {}  # type: Dict[str, Dict[str, str]]
 
     def to_json(self):
         # type: () -> dict