ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject ambari git commit: AMBARI-18810. Hive View shows LDAP login pop-up for all login errors. (Ashwin Rajeev via dipayanb)
Date Sat, 12 Nov 2016 18:26:23 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk fa8f8405f -> 8424364e7


AMBARI-18810. Hive View shows LDAP login pop-up for all login errors. (Ashwin Rajeev via dipayanb)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8424364e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8424364e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8424364e

Branch: refs/heads/trunk
Commit: 8424364e74a0153d662f75356eef41ee80656c26
Parents: fa8f840
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Sat Nov 12 23:54:38 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Sat Nov 12 23:55:56 2016 +0530

----------------------------------------------------------------------
 .../resources/browser/ConnectionService.java      |  8 ++++----
 .../ui/hive-web/app/controllers/splash.js         | 18 ++++++++++++++++--
 .../resources/ui/hive-web/app/routes/splash.js    |  7 ++++++-
 3 files changed, 26 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8424364e/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/browser/ConnectionService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/browser/ConnectionService.java
b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/browser/ConnectionService.java
index cd4d30e..d71d7da 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/browser/ConnectionService.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/browser/ConnectionService.java
@@ -80,9 +80,9 @@ public class ConnectionService {
       // get the password
         String pass = password.get();
       // password may be stale, try to connect to Hive
-        return attemptHiveConnection(pass);
+        return attemptHiveConnection(pass,ldapEnabled);
     }
-      return attemptHiveConnection(NO_PASSWORD);
+      return attemptHiveConnection(NO_PASSWORD,ldapEnabled);
 
   }
 
@@ -95,7 +95,7 @@ public class ConnectionService {
         return Response.ok().entity(response).type(MediaType.APPLICATION_JSON).build();
     }
 
-    private Response attemptHiveConnection(String pass) {
+    private Response attemptHiveConnection(String pass, boolean ldapEnabled) {
         ConnectionConfig connectionConfig = ConnectionFactory.create(context);
         HiveConnectionWrapper hiveConnectionWrapper = new HiveConnectionWrapper(connectionConfig.getJdbcUrl(),
connectionConfig.getUsername(), pass,new AuthParams(context));
         try {
@@ -105,7 +105,7 @@ public class ConnectionService {
           // check the message to see if the cause was a login failure
           // return a 401
           // else return a 500
-          if(isLoginError(e))
+          if(isLoginError(e) && ldapEnabled)
             return Response.status(Response.Status.UNAUTHORIZED).build();
           else
               throw new ServiceFormattedException(e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/ambari/blob/8424364e/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js
b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js
index 97b3ea6..1bf6d42 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js
@@ -41,12 +41,26 @@ checkConnection: function() {
         .then(
             function(data) {
               console.log("fulfil");
-              model.set('ldapSuccess',true);
+              model.set('ldapFailure',false);
             },
             function(reason) {
               console.log("fail");
               if(reason.status === 401){
-                model.set('ldapSuccess',false);
+                model.set('ldapFailure',true);
+              } else {
+
+                  var data = reason.responseJSON;
+                  var checkFailedMessage = "Service Hive check failed";
+                  var errors = self.get("errors");
+                  errors += checkFailedMessage;
+                  errors += (data.message) ? (': <i>' + data.message + '</i><br>')
: '<br>';
+                  self.set("errors", errors);
+
+                if (data.trace != null) {
+                  var stackTrace = self.get("stackTrace");
+                  stackTrace += checkFailedMessage + ':\n' + data.trace;
+                  self.set("stackTrace", stackTrace);
+                }
               }
             }
         );

http://git-wip-us.apache.org/repos/asf/ambari/blob/8424364e/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js
index 6328256..e2601f9 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js
@@ -64,7 +64,7 @@ export default Ember.Route.extend({
       model.set('percent', percent + 25);
       loadView();
     },function(){
-        if(!model.get('ldapSuccess')) {
+        if(model.get('ldapFailure')) {
           var percent = model.get('percent');
           controller.requestLdapPassword(function(){
             // check the connection again
@@ -86,6 +86,11 @@ export default Ember.Route.extend({
               loadView();
             });
           });
+        } else {
+          model.get("hiveserverTest",false);
+          model.set("hiveserver" + 'TestDone', true);
+          model.set('percent', model.get('percent') + 25);
+          loadView();
         }
     });
 


Mime
View raw message