You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by db...@apache.org on 2016/11/12 18:25:39 UTC
ambari git commit: AMBARI-18810. Hive View shows LDAP login pop-up
for all login errors. (Ashwin Rajeev via dipayanb)
Repository: ambari
Updated Branches:
refs/heads/branch-2.5 84972e3b8 -> edb5b6604
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/edb5b660
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/edb5b660
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/edb5b660
Branch: refs/heads/branch-2.5
Commit: edb5b66044ef78dcff53ea13ac0e030becea0677
Parents: 84972e3
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Sat Nov 12 23:54:38 2016 +0530
Committer: Dipayan Bhowmick <di...@gmail.com>
Committed: Sat Nov 12 23:54:38 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/edb5b660/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/edb5b660/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/edb5b660/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();
}
});