This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch ranger-2.7
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/ranger-2.7 by this push:
     new 30b9f910ab RANGER-5146: 500 API Error When Deleting TagDef with a 
Linked Tag
30b9f910ab is described below

commit 30b9f910ab8ad929ef4ffc73f17eb06efdafa64b
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
    
    (cherry picked from commit ff36aabe36169b94862c51a5b403f59c9d728b94)
---
 .../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 d6cced8816..9b9b70649f 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
@@ -336,6 +336,7 @@ public WebApplicationException createRESTException(int 
responseCode,
                VXResponse response = new VXResponse();
 
                response.setMsgDesc(logMessage);
+               response.setStatusCode(responseCode);
 
                Response errorResponse = Response
                                .status(responseCode).entity(response).build();
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 6675d71a6d..7f38061f9f 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
@@ -211,6 +211,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) {
         if(LOG.isDebugEnabled()) {
@@ -232,6 +233,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) {
         if(LOG.isDebugEnabled()) {

Reply via email to