From 5da3eb11ac36851ebd7fd2c59290ed6914f608bb Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 1 May 2024 10:57:02 -0400 Subject: [PATCH] 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 --- src/pybind/mgr/smb/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: -- 2.39.5