Sfoglia il codice sorgente

AMBARI-14159 UI Revisit "dfs.namenode.rpc-address" property usage in NN HA environment (akovalenko)

Aleksandr Kovalenko 9 anni fa
parent
commit
c2f1cef29f

+ 1 - 1
ambari-web/app/controllers/main/service/reassign/step4_controller.js

@@ -311,7 +311,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
       if (additionalConfigs.hasOwnProperty(site)) {
         for (var property in additionalConfigs[site]) {
           if (additionalConfigs[site].hasOwnProperty(property)) {
-            if (App.get('isHaEnabled') && componentName === 'NAMENODE' && property === 'fs.defaultFS') continue;
+            if (App.get('isHaEnabled') && componentName === 'NAMENODE' && (property === 'fs.defaultFS' || property === 'dfs.namenode.rpc-address')) continue;
 
             configs[site][property] = additionalConfigs[site][property].replace('<replace-value>', replaceValue);
           }

+ 26 - 0
ambari-web/test/controllers/main/service/reassign/step4_controller_test.js

@@ -38,6 +38,14 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
 
   describe('#setAdditionalConfigs()', function () {
 
+    beforeEach(function () {
+      sinon.stub(App, 'get').withArgs('isHaEnabled').returns(true);
+    });
+
+    afterEach(function () {
+      App.get.restore();
+    });
+
     it('Component is absent', function () {
       controller.set('additionalConfigsMap', []);
       var configs = {};
@@ -73,6 +81,24 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
         }
       });
     });
+
+    it('ignore some configs for NameNode after HA', function () {
+      controller.set('additionalConfigsMap', [
+        {
+          componentName: 'NAMENODE',
+          configs: {
+            'test-site': {
+              'fs.defaultFS': '<replace-value>:1111',
+              'dfs.namenode.rpc-address': '<replace-value>:1111'
+            }
+          }
+        }
+      ]);
+      var configs = {'test-site': {}};
+
+      expect(controller.setAdditionalConfigs(configs, 'NAMENODE', 'host1')).to.be.true;
+      expect(configs).to.eql({'test-site': {}});
+    });
   });
 
   describe('#getHostComponentsNames()', function () {