From 7ed7f02f62f8f27a93df8c9250872bc9c7ac9711 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Tue, 16 Dec 2025 10:25:58 -0500 Subject: [PATCH] mgr/smb: move resource types to class level Move resource types to class level to make these more obvious for future modifications. Signed-off-by: John Mulligan --- src/pybind/mgr/smb/handler.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pybind/mgr/smb/handler.py b/src/pybind/mgr/smb/handler.py index 51189a74e34..027931a4c59 100644 --- a/src/pybind/mgr/smb/handler.py +++ b/src/pybind/mgr/smb/handler.py @@ -146,6 +146,14 @@ class _FakeAuthorizer: class _Matcher: + _match_resources = ( + resources.Cluster, + resources.Share, + resources.JoinAuth, + resources.UsersAndGroups, + resources.TLSCredential, + ) + def __init__(self) -> None: self._contents: Set[Any] = set() self._inputs: Set[str] = set() @@ -175,14 +183,7 @@ class _Matcher: def parse(self, txt: str) -> None: rtypes: Dict[str, Any] = { - cast(Any, r).resource_type: r - for r in ( - resources.Cluster, - resources.Share, - resources.JoinAuth, - resources.UsersAndGroups, - resources.TLSCredential, - ) + cast(Any, r).resource_type: r for r in self._match_resources } if txt in rtypes: resource_cls = rtypes[txt] -- 2.47.3