From bba802ab298c129037405987cd5e3909915d0d9e Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 8 May 2024 13:27:57 -0400 Subject: [PATCH] mgr/smb: extra check that we don't iterate over non-lists Signed-off-by: John Mulligan --- src/pybind/mgr/smb/resourcelib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pybind/mgr/smb/resourcelib.py b/src/pybind/mgr/smb/resourcelib.py index 63dfaa837c0..ea7a82263bd 100644 --- a/src/pybind/mgr/smb/resourcelib.py +++ b/src/pybind/mgr/smb/resourcelib.py @@ -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: -- 2.39.5