Skip to content

Commit ee6b29b

Browse files
mgr/smb: add docstrings to a few staging.py functions
Signed-off-by: John Mulligan <[email protected]>
1 parent f0ffb26 commit ee6b29b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/pybind/mgr/smb/staging.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646

4747

4848
class Staging:
49+
"""A virtual store used to compile pending changes before saving them in
50+
the destination store.
51+
"""
52+
4953
def __init__(self, store: ConfigStore) -> None:
5054
self.destination_store = store
5155
self.incoming: Dict[EntryKey, SMBResource] = {}
@@ -139,6 +143,9 @@ def _save(self, resource: SMBResource) -> Result:
139143

140144

141145
def auth_refs(cluster: resources.Cluster) -> Collection[str]:
146+
"""Return all IDs for join_auth resources referenced by the supplied
147+
cluster.
148+
"""
142149
if cluster.auth_mode != AuthMode.ACTIVE_DIRECTORY:
143150
return set()
144151
return {
@@ -149,6 +156,9 @@ def auth_refs(cluster: resources.Cluster) -> Collection[str]:
149156

150157

151158
def ug_refs(cluster: resources.Cluster) -> Collection[str]:
159+
"""Return all IDs for users_and_groups resources referenced by the supplied
160+
cluster.
161+
"""
152162
if (
153163
cluster.auth_mode != AuthMode.USER
154164
or cluster.user_group_settings is None
@@ -169,6 +179,12 @@ def cross_check_resource(
169179
path_resolver: PathResolver,
170180
earmark_resolver: EarmarkResolver,
171181
) -> None:
182+
"""Check a given resource for consistency across the set of other resources
183+
in the virtual transaction represented by the staging store and
184+
resolver-helpers.
185+
186+
The cross-check is only for things outside the scope of a single resource.
187+
"""
172188
raise TypeError(f'not a valid smb resource: {type(resource)}')
173189

174190

0 commit comments

Comments
 (0)