You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ma...@apache.org on 2020/08/09 17:45:12 UTC

[ranger] branch master updated: RANGER-2945: fix to handle missing password in Presto service-config

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

madhan 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 756cf23  RANGER-2945: fix to handle missing password in Presto service-config
756cf23 is described below

commit 756cf23c4aa7eeae82c9c254409a9c8637d56dec
Author: joey.ljy <jo...@alibaba-inc.com>
AuthorDate: Sat Aug 8 13:50:43 2020 +0800

    RANGER-2945: fix to handle missing password in Presto service-config
    
    Signed-off-by: Madhan Neethiraj <ma...@apache.org>
---
 .../org/apache/ranger/services/presto/RangerServicePresto.java     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/plugin-presto/src/main/java/org/apache/ranger/services/presto/RangerServicePresto.java b/plugin-presto/src/main/java/org/apache/ranger/services/presto/RangerServicePresto.java
index f41b2c8..810fc3f 100644
--- a/plugin-presto/src/main/java/org/apache/ranger/services/presto/RangerServicePresto.java
+++ b/plugin-presto/src/main/java/org/apache/ranger/services/presto/RangerServicePresto.java
@@ -20,6 +20,7 @@ package org.apache.ranger.services.presto;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.ranger.plugin.client.HadoopConfigHolder;
 import org.apache.ranger.plugin.client.HadoopException;
 import org.apache.ranger.plugin.service.RangerBaseService;
 import org.apache.ranger.plugin.service.ResourceLookupContext;
@@ -45,6 +46,9 @@ public class RangerServicePresto extends RangerBaseService {
 
     if (configs != null) {
       try {
+        if (!configs.containsKey(HadoopConfigHolder.RANGER_LOGIN_PASSWORD)) {
+          configs.put(HadoopConfigHolder.RANGER_LOGIN_PASSWORD, null);
+        }
         ret = PrestoResourceManager.connectionTest(serviceName, configs);
       } catch (HadoopException he) {
         LOG.error("<== RangerServicePresto.validateConfig Error:" + he);
@@ -71,6 +75,9 @@ public class RangerServicePresto extends RangerBaseService {
     }
     if (context != null) {
       try {
+        if (!configs.containsKey(HadoopConfigHolder.RANGER_LOGIN_PASSWORD)) {
+          configs.put(HadoopConfigHolder.RANGER_LOGIN_PASSWORD, null);
+        }
         ret  = PrestoResourceManager.getPrestoResources(serviceName, serviceType, configs,context);
       } catch (Exception e) {
         LOG.error( "<==RangerServicePresto.lookupResource Error : " + e);