This is an automated email from the ASF dual-hosted git repository.
dineshkumar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/master by this push:
new ff36aabe36 RANGER-5146: 500 API Error When Deleting TagDef with a
Linked Tag
ff36aabe36 is described below
commit ff36aabe36169b94862c51a5b403f59c9d728b94
Author: Dineshkumar Yadav <[email protected]>
AuthorDate: Mon Feb 17 11:55:48 2025 +0530
RANGER-5146: 500 API Error When Deleting TagDef with a Linked Tag
---
.../src/main/java/org/apache/ranger/common/RESTErrorUtil.java | 1 +
security-admin/src/main/java/org/apache/ranger/rest/TagREST.java | 2 ++
2 files changed, 3 insertions(+)
diff --git
a/security-admin/src/main/java/org/apache/ranger/common/RESTErrorUtil.java
b/security-admin/src/main/java/org/apache/ranger/common/RESTErrorUtil.java
index 611963376c..34145c45f2 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/RESTErrorUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/RESTErrorUtil.java
@@ -324,6 +324,7 @@ public WebApplicationException createRESTException(int
responseCode, String logM
VXResponse response = new VXResponse();
response.setMsgDesc(logMessage);
+ response.setStatusCode(responseCode);
Response errorResponse =
Response.status(responseCode).entity(response).build();
WebApplicationException restException = new
WebApplicationException(errorResponse);
diff --git a/security-admin/src/main/java/org/apache/ranger/rest/TagREST.java
b/security-admin/src/main/java/org/apache/ranger/rest/TagREST.java
index 92535a453f..a3adb1bf13 100755
--- a/security-admin/src/main/java/org/apache/ranger/rest/TagREST.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/TagREST.java
@@ -201,6 +201,7 @@ public RangerTagDef updateTagDef(@PathParam("id") Long id,
RangerTagDef tagDef)
@DELETE
@Path(TagRESTConstants.TAGDEF_RESOURCE + "{id}")
+ @Produces("application/json")
@PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
public void deleteTagDef(@PathParam("id") Long id) {
LOG.debug("==> TagREST.deleteTagDef({})", id);
@@ -218,6 +219,7 @@ public void deleteTagDef(@PathParam("id") Long id) {
@DELETE
@Path(TagRESTConstants.TAGDEF_RESOURCE + "guid/{guid}")
+ @Produces("application/json")
@PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
public void deleteTagDefByGuid(@PathParam("guid") String guid) {
LOG.debug("==> TagREST.deleteTagDefByGuid({})", guid);