Browse Source

AMBARI-9162. Kerberos wizard: Test Connectivity button does not work. (jaimin)

Jaimin Jetly 10 years ago
parent
commit
c7528452c5
2 changed files with 21 additions and 5 deletions
  1. 3 4
      ambari-web/app/utils/ajax/ajax.js
  2. 18 1
      ambari-web/app/views/wizard/controls_view.js

+ 3 - 4
ambari-web/app/utils/ajax/ajax.js

@@ -1407,11 +1407,10 @@ var urls = {
   'admin.kerberos_security.test_connection': {
     'real': '/kdc_check/{kdcHostname}',
     'mock': '',
-    'format': function (data) {
+    'format': function () {
       return {
-        type: 'POST',
-        data: JSON.stringify(data)
-      }
+        dataType: 'text'
+      };
     }
   },
 

+ 18 - 1
ambari-web/app/views/wizard/controls_view.js

@@ -1031,11 +1031,28 @@ App.CheckDBConnectionView = Ember.View.extend({
       data: {
         kdcHostname: this.get('masterHostName')
       },
-      success: 'onCreateActionSuccess',
+      success: 'onRunKDCCheckSuccess',
       error: 'onCreateActionError'
     });
   },
 
+  /**
+   *
+   * @param data
+   */
+  onRunKDCCheckSuccess: function(data) {
+    var statusCode = {
+      success: 'REACHABLE',
+      failed: 'UNREACHABLE'
+    };
+    if (data == statusCode['success']) {
+      this.setResponseStatus('success');
+    } else {
+      this.setResponseStatus('failed');
+    }
+    this.set('responseFromServer', data);
+  },
+
   /**
    * Run custom action for database connection.
    *