]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/smb: reorganize internal.py to use fewer if-isinstance blocks
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 1 Jul 2025 15:28:02 +0000 (11:28 -0400)
committerAdam King <adking@redhat.com>
Thu, 10 Jul 2025 16:02:38 +0000 (12:02 -0400)
commitba893d04ee63ea2ba15ca34d36725c5e882d1f47
treebd4bcbc9f727cd51405b80d133cf85b0abd64732
parentf2f018ff4722bba3801683bc20846c69043c5a0a
mgr/smb: reorganize internal.py to use fewer if-isinstance blocks

While working on adding a new top-level resource type I realized that
this code can be a bit error prone and un-DRY. Use a single method for
mapping between resource classes and resource entry classes and refactor
the rest of the module around that idea.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit c81a666fe071afb1ea8cc6adba20d09eb38cc9d6)
src/pybind/mgr/smb/internal.py