Skip to content

Commit 5da3eb1

Browse files
mgr/smb: share and cluster create commands only create resources
Prior to this change the create commands could be used counter to the term 'create' as a create-or-update command. IMO this violates the principle of least surprise so make them create-only. Signed-off-by: John Mulligan <[email protected]>
1 parent 751bae6 commit 5da3eb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pybind/mgr/smb/module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def cluster_create(
178178
placement=pspec,
179179
)
180180
to_apply.append(cluster)
181-
return self._handler.apply(to_apply).squash(cluster)
181+
return self._handler.apply(to_apply, create_only=True).squash(cluster)
182182

183183
@cli.SMBCommand('cluster rm', perm='rw')
184184
def cluster_rm(self, cluster_id: str) -> handler.Result:
@@ -220,7 +220,7 @@ def share_create(
220220
subvolume=subvolume,
221221
),
222222
)
223-
return self._handler.apply([share]).one()
223+
return self._handler.apply([share], create_only=True).one()
224224

225225
@cli.SMBCommand('share rm', perm='rw')
226226
def share_rm(self, cluster_id: str, share_id: str) -> handler.Result:

0 commit comments

Comments
 (0)