From: John Mulligan Date: Wed, 1 May 2024 14:57:02 +0000 (-0400) Subject: mgr/smb: share and cluster create commands only create resources X-Git-Tag: testing/wip-pdonnell-testing-20240622.145006-debug~50^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5da3eb11ac36851ebd7fd2c59290ed6914f608bb;p=ceph-ci.git 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 --- diff --git a/src/pybind/mgr/smb/module.py b/src/pybind/mgr/smb/module.py index a6eef0cb4fb..fcaf2d3d670 100644 --- a/src/pybind/mgr/smb/module.py +++ b/src/pybind/mgr/smb/module.py @@ -178,7 +178,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule): placement=pspec, ) to_apply.append(cluster) - return self._handler.apply(to_apply).squash(cluster) + return self._handler.apply(to_apply, create_only=True).squash(cluster) @cli.SMBCommand('cluster rm', perm='rw') def cluster_rm(self, cluster_id: str) -> handler.Result: @@ -220,7 +220,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule): subvolume=subvolume, ), ) - return self._handler.apply([share]).one() + return self._handler.apply([share], create_only=True).one() @cli.SMBCommand('share rm', perm='rw') def share_rm(self, cluster_id: str, share_id: str) -> handler.Result: