]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/smb: add a new error type to reflect non-matching inputs
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 21 Apr 2026 18:30:13 +0000 (14:30 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 6 May 2026 19:41:26 +0000 (15:41 -0400)
It's not that the input was bad, it just reflects that nothing
matching the input value was found.

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

index f6a97dc8748e113c6c3ba9e040888263fd07bf2e..8b70675a0a98154c52c415b7f5397cd87bf555a0 100644 (file)
@@ -76,6 +76,11 @@ class InvalidInputValue(object_format.ErrorResponseBase):
         return -errno.EINVAL, "", str(self)
 
 
+class NoMatchingValue(object_format.ErrorResponseBase):
+    def format_response(self) -> Tuple[int, str, str]:
+        return -errno.ENOENT, "", str(self)
+
+
 @contextlib.contextmanager
 def error_wrapper() -> Iterator[None]:
     """Context-decorator that converts between certain common exception types."""