You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by pa...@apache.org on 2016/03/18 08:15:39 UTC

ambari git commit: AMBARI-15424. Manual re-execution is required after entering the password for LDAP (pallavkul)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 3cfea2267 -> 6cc2008d2


AMBARI-15424. Manual re-execution is required after entering the password for LDAP (pallavkul)


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

Branch: refs/heads/branch-2.2
Commit: 6cc2008d24f37b4366224ed3f0245719f56bf2bb
Parents: 3cfea22
Author: Pallav Kulshreshtha <pa...@gmail.com>
Authored: Fri Mar 18 12:45:12 2016 +0530
Committer: Pallav Kulshreshtha <pa...@gmail.com>
Committed: Fri Mar 18 12:45:12 2016 +0530

----------------------------------------------------------------------
 .../ui/hive-web/app/controllers/databases.js       |  5 +----
 .../resources/ui/hive-web/app/controllers/index.js | 17 ++++++++++-------
 2 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6cc2008d/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js
index 2a69349..a841e3b 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js
@@ -230,8 +230,6 @@ export default Ember.Controller.extend({
       var self = this,
           defer = Ember.RSVP.defer();
 
-      self.getDatabases = this.getDatabases;
-
       this.send('openModal', 'modal-save', {
         heading: "modals.authenticationLDAP.heading",
         text:"",
@@ -250,7 +248,6 @@ export default Ember.Controller.extend({
 
         $.ajax({
           url: ldapAuthURL,
-          dataType: "json",
           type: 'post',
           headers: {'X-Requested-With': 'XMLHttpRequest', 'X-Requested-By': 'ambari'},
           contentType: 'application/json',
@@ -258,13 +255,13 @@ export default Ember.Controller.extend({
           success: function( data, textStatus, jQxhr ){
             console.log( "LDAP done: " + data );
             self.getDatabases();
+            self.syncDatabases();
           },
           error: function( jqXhr, textStatus, errorThrown ){
             console.log( "LDAP fail: " + errorThrown );
             self.get('notifyService').error( "Wrong Credentials." );
           }
         });
-
       });
     },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6cc2008d/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
index a056759..c6f50f4 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
@@ -488,8 +488,6 @@ export default Ember.Controller.extend({
             self = this,
             defer = Ember.RSVP.defer();
 
-        self.createJob = this.createJob;
-
         this.send('openModal', 'modal-save', {
           heading: "modals.authenticationLDAP.heading",
           text:"",
@@ -506,21 +504,26 @@ export default Ember.Controller.extend({
             var hiveViewName = pathNameArray[4];
             var ldapAuthURL = "/api/v1/views/HIVE/versions/"+ hiveViewVersion + "/instances/" + hiveViewName + "/jobs/auth";
 
-
             $.ajax({
                 url: ldapAuthURL,
-                dataType: "json",
                 type: 'post',
                 headers: {'X-Requested-With': 'XMLHttpRequest', 'X-Requested-By': 'ambari'},
                 contentType: 'application/json',
                 data: JSON.stringify({ "password" : password}),
                 success: function( data, textStatus, jQxhr ){
-                    console.log( "LDAP done: " + data );
-                    self.createJob (job,originalModel);
+
+                  self.get('databaseService').getDatabases().then(function (databases) {
+                    var selectedDatabase = self.get('databaseService.selectedDatabase.name') || 'default';
+                    self.get('databaseService').setDatabaseByName( selectedDatabase);
+                    return self.send('executeQuery', 'job', self.get('openQueries.currentQuery.fileContent') );
+                  }).catch(function (error) {
+                    self.get('notifyService').error( "Error in accessing databases." );
+                  });
+
                 },
                 error: function( jqXhr, textStatus, errorThrown ){
                     console.log( "LDAP fail: " + errorThrown );
-                        self.get('notifyService').error( "Wrong Credentials." );
+                    self.get('notifyService').error( "Wrong Credentials." );
                 }
             });