Browse Source

AMBARI-1705. Remove redundant API calls to update service configuration while disabling security. (jaimin)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1460894 13f79535-47bb-0310-9956-ffa450edef68
Jaimin Jetly 12 năm trước cách đây
mục cha
commit
a3c06d7304
2 tập tin đã thay đổi với 23 bổ sung21 xóa
  1. 3 0
      CHANGES.txt
  2. 20 21
      ambari-web/app/controllers/main/admin/security/disable.js

+ 3 - 0
CHANGES.txt

@@ -519,6 +519,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1705. Remove redundant API calls to update service configuration
+ while disabling security. (jaimin)
+
  AMBARI-1661. For custom advanced properties, a new config with an empty key
  can be added. (yusaku)
 

+ 20 - 21
ambari-web/app/controllers/main/admin/security/disable.js

@@ -32,6 +32,7 @@ App.MainAdminSecurityDisableController = Em.Controller.extend({
   clearStep: function () {
     this.get('stages').clear();
     this.get('secureServices').clear();
+    this.get('serviceConfigTags').clear();
   },
 
   loadStep: function () {
@@ -126,6 +127,25 @@ App.MainAdminSecurityDisableController = Em.Controller.extend({
     stage4.set('data', data);
   },
 
+  /**
+   * set tagnames for configuration of the *-site.xml
+   */
+  setServiceTagNames: function (secureService, configs) {
+    for (var index in configs) {
+      if (secureService.sites.contains(index)) {
+        var serviceConfigObj = {
+          siteName: index,
+          tagName: configs[index].tag,
+          newTagName: null,
+          configs: {}
+        };
+        console.log("The value of serviceConfigTags[index]: " + configs[index]);
+        this.get('serviceConfigTags').pushObject(serviceConfigObj);
+      }
+    }
+    return serviceConfigObj;
+  },
+
   loadClusterConfigs: function () {
     var self = this;
     var url = App.apiPrefix + '/clusters/' + App.router.getClusterName();
@@ -237,27 +257,6 @@ App.MainAdminSecurityDisableController = Em.Controller.extend({
     });
   },
 
-  /**
-   * set tagnames for configuration of the *-site.xml
-   */
-  setServiceTagNames: function (secureServiceName, configs) {
-    console.log("TRACE: In setServiceTagNames function:");
-    //var serviceConfigTags = this.get('serviceConfigTags');
-    for (var index in configs) {
-      var serviceConfigObj = {
-        serviceName: secureServiceName,
-        siteName: index,
-        tagName: configs[index].tag,
-        newTagName: null,
-        configs: {}
-      };
-      console.log("The value of serviceConfigTags[index]: " + configs[index]);
-      this.get('serviceConfigTags').pushObject(serviceConfigObj);
-    }
-    return serviceConfigObj;
-  },
-
-
   getAllConfigsFromServer: function () {
     this.set('noOfWaitingAjaxCalls', this.get('serviceConfigTags').length - 1);
     this.get('serviceConfigTags').forEach(function (_serviceConfigTags) {