Drop Code related to OperationNotPermitted exception

The following exception was added in initial import of watcher
code base[1].

In each of the controller REST APIs, it was called with a flag
stating request was coming from top level resources apis.

But this exception and code was not used anywhere in the
rest api. It seems to be a dead code. So, it needs to be
cleaned up.

Note: In audit_template, under patchapi, this exception
was used for not removal goal from audit template.

Since this cr drops this exception, It replace the same
with NotAuthorized exception keeping status code same.

Links:
[1]. d14e057da1 (diff-6d510a275605e20ba8b435157062da2b749265a88a3cfd6d90abb7e8e5feac2aR235)

Closes-Bug: #2115968

Change-Id: I82a5e4a7a51726b3a89257c84a75157fbfcb82eb
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
This commit is contained in:
Chandan Kumar (raukadah)
2025-07-04 17:57:30 +05:30
parent c0a5abe29c
commit e3b813e27e
12 changed files with 11 additions and 84 deletions

View File

@@ -0,0 +1,9 @@
---
other:
- |
Removed unused ``OperationNotPermitted`` exception that was dead code
since the initial import of the Watcher codebase. This exception was
not used anywhere in the REST API controllers except for preventing
goal removal from audit templates. The functionality has been replaced
with the standard ``wsme.exc.ClientSideError`` exception, which provides
the appropriate 400 Bad Request response behavior.