]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/smb: move logic validating cluster changes to handler
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 11 Oct 2024 18:33:19 +0000 (14:33 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Sat, 12 Oct 2024 17:37:51 +0000 (13:37 -0400)
commit263c0f8e73071486ebb87f4dbdfdd4f440299008
tree0eacc56d2074e27296e563ba9dd348be31da4c5c
parent2f7fe668fe21da13bfe94f12d029433ff237bd0c
mgr/smb: move logic validating cluster changes to handler

When I first wrote the internal module for working with serialized
objects in the internal store it seems to make sense to do some
validation in the cluster class. At the time it was one of the few
places in the code that would have both the new and old cluster objects
for comparison. However, the code evolved and the handler module grew
more responsibility for validation especially as it needed to do
cross-object validation (do the cluster and share values align, etc).
In addition, I initially couldn't find the code that handled the
validation because I forgot there was validation in internal.py.

Move the logic used to validate that certain properties of a cluster are
unchanged into handler.py and out of internal.py. This makes the classes
in internal.py even more regular as a bonus.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/smb/handler.py
src/pybind/mgr/smb/internal.py