From: John Mulligan Date: Tue, 16 Dec 2025 15:25:58 +0000 (-0500) Subject: mgr/smb: move resource types to class level X-Git-Tag: testing/wip-vshankar-testing-20260222.101816~7^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ed7f02f62f8f27a93df8c9250872bc9c7ac9711;p=ceph-ci.git 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 --- 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]