]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/smb: extra check that we don't iterate over non-lists
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 8 May 2024 17:27:57 +0000 (13:27 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 24 Jun 2024 12:41:08 +0000 (08:41 -0400)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/smb/resourcelib.py

index 63dfaa837c0e23a00ca552246949686ca09e9436..ea7a82263bd0ddf7051c4b7c5241bde7e0369eac 100644 (file)
@@ -650,6 +650,7 @@ def load(data: Simplified) -> List[Any]:
     """
     # Given a bare list/iterator. Assume it contains loadable objects.
     if not isinstance(data, dict):
+        assert not isinstance(data, (str, bytes))
         return list(chain.from_iterable(load(v) for v in data))
     # Given a "list object"
     if _RESOURCE_TYPE not in data and _RESOURCES in data: