You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by GitBox <gi...@apache.org> on 2021/07/17 03:09:41 UTC

[GitHub] [ranger] alvaroqueiroz opened a new pull request #110: Python ranger_client call_api - add case for 404 response

alvaroqueiroz opened a new pull request #110:
URL: https://github.com/apache/ranger/pull/110


   One exemple of problem:
   When using the method ranger.get_policy(), if the policy do not exists, i get the following error:
   
   ![image](https://user-images.githubusercontent.com/23335136/126023407-e0efa40c-28a9-4937-b570-fe72242a01d5.png)
   
   This will happen with other resources too.
   
   This happens because the API call do not have a case for dealing with the response 404 (resource do not exist).
   So i'm adding it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-885939343


   @mneethiraj thank you for your comments, the changes make sense.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on a change in pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on a change in pull request #110:
URL: https://github.com/apache/ranger/pull/110#discussion_r675888346



##########
File path: intg/src/main/python/apache_ranger/client/ranger_client.py
##########
@@ -324,6 +324,11 @@ def __call_api(self, api, query_params=None, request_data=None):
             LOG.error("Ranger admin unavailable. HTTP Status: %s", HTTPStatus.SERVICE_UNAVAILABLE)
 
             ret = None
+        elif response.status_code == HTTPStatus.SERVICE_NOT_FOUND:

Review comment:
       thanks for the comments @mneethiraj, it makes sense




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-885282906


   @chia7712 my friend, do you know any body that can look at my PR? hahaha
   
   I mean, is there any active ranger committer i can call?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] chia7712 commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-881808715


   > Can you help me with this CI error? :)
   
   I filed a PR (#105) to fix CI. However, I'm not Ranger committer so it needs love from other guys :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-887928487


   @mneethiraj is everything fine?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-884855149


   @kulkabhay @coheigea @rameeshm @gautamborad @zhangqiang2 @sneethiraj 
   Please, can any of you review this PR? i need use it in my application, and @chia7712 do not repond  :(


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] mneethiraj commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
mneethiraj commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-898586995


   @alvaroqueiroz  - thank you for the patch with the updates. I filed [RANGER-3370](https://issues.apache.org/jira/browse/RANGER-3370), and merged this patch in master and ranger-2.2 branches.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-895536744


   @mneethiraj can you please take a look?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-898390344


   @mneethiraj ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz edited a comment on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz edited a comment on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-881808391


   @chia7712 Can you help me with this CI error? :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] mneethiraj closed pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
mneethiraj closed pull request #110:
URL: https://github.com/apache/ranger/pull/110


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] chia7712 commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-885459813


   > I mean, is there any active ranger committer i can call?
   
   Sorry that I'm newbie in ranger community :(


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-891028836


   @mneethiraj ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-881809253


   @chia7712 thank you for your fast response, i will try to get the attention of the comitters


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-881809121


   @mneethiraj can you take a look at this PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz edited a comment on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz edited a comment on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-884855149


   @kulkabhay @coheigea @rameeshm @gautamborad @zhangqiang2 @sneethiraj 
   Please, can any of you review this PR? i need use it in my application, and @mneethiraj do not repond  :(


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] alvaroqueiroz commented on pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
alvaroqueiroz commented on pull request #110:
URL: https://github.com/apache/ranger/pull/110#issuecomment-881808391


   @chia7712 Can you help me with de CI error? :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] mneethiraj commented on a change in pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
mneethiraj commented on a change in pull request #110:
URL: https://github.com/apache/ranger/pull/110#discussion_r675874781



##########
File path: intg/src/main/python/apache_ranger/client/ranger_client.py
##########
@@ -324,6 +324,11 @@ def __call_api(self, api, query_params=None, request_data=None):
             LOG.error("Ranger admin unavailable. HTTP Status: %s", HTTPStatus.SERVICE_UNAVAILABLE)
 
             ret = None
+        elif response.status_code == HTTPStatus.SERVICE_NOT_FOUND:
+            LOG.error("Ranger service not found. HTTP Status: %s", HTTPStatus.SERVICE_NOT_FOUND)

Review comment:
       "Ranger service not found" => "Not found"




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ranger] mneethiraj commented on a change in pull request #110: Python ranger_client call_api - add case for 404 response

Posted by GitBox <gi...@apache.org>.
mneethiraj commented on a change in pull request #110:
URL: https://github.com/apache/ranger/pull/110#discussion_r675874536



##########
File path: intg/src/main/python/apache_ranger/client/ranger_client.py
##########
@@ -324,6 +324,11 @@ def __call_api(self, api, query_params=None, request_data=None):
             LOG.error("Ranger admin unavailable. HTTP Status: %s", HTTPStatus.SERVICE_UNAVAILABLE)
 
             ret = None
+        elif response.status_code == HTTPStatus.SERVICE_NOT_FOUND:

Review comment:
       Consider renaming SERVICE_NOT_FOUND => NOT_FOUND.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org