Kaynağa Gözat

AMBARI-12590 Redundant nimbus.seeds config merge warning among pre-upgrade check results. (atkach)

Andrii Tkach 10 yıl önce
ebeveyn
işleme
a1e0caedd0

+ 1 - 1
ambari-web/app/controllers/main/host/details.js

@@ -1025,7 +1025,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.ComponentActionsMixin,
    * @method updateStormConfigs
    */
   updateStormConfigs: function () {
-    if (App.Service.find().findProperty('serviceName', 'STORM')) {
+    if (App.Service.find('STORM').get('isLoaded') && App.get('isHadoop23Stack')) {
       this.loadConfigs("loadStormConfigs");
     }
   },

+ 11 - 0
ambari-web/app/data/HDP2.3/site_properties.js

@@ -399,6 +399,17 @@ hdp23properties.push({
     "category": "Advanced ranger-yarn-audit",
     "serviceName": "YARN"
   },
+  {
+    "id": "site property",
+    "name": "nimbus.seeds",
+    "displayName": "nimbus.seeds",
+    "isReconfigurable": false,
+    "isOverridable": false,
+    "displayType": "masterHosts",
+    "serviceName": "STORM",
+    "filename": "storm-site.xml",
+    "category": "NIMBUS"
+  },
   {
     "id": "site property",
     "name": "xasecure.audit.destination.db",

+ 0 - 11
ambari-web/app/data/HDP2/site_properties.js

@@ -1058,17 +1058,6 @@ var hdp2properties = [
     "filename": "storm-site.xml",
     "category": "NIMBUS"
   },
-  {
-    "id": "site property",
-    "name": "nimbus.seeds",
-    "displayName": "nimbus.seeds",
-    "isReconfigurable": false,
-    "isOverridable": false,
-    "displayType": "masterHosts",
-    "serviceName": "STORM",
-    "filename": "storm-site.xml",
-    "category": "NIMBUS"
-  },
   {
     "id": "site property",
     "name": "nimbus.thrift.port",

+ 71 - 0
ambari-web/test/controllers/main/host/details_test.js

@@ -2819,4 +2819,75 @@ describe('App.MainHostDetailsController', function () {
     });
 
   });
+
+  describe("#removeHostComponentModel()", function () {
+    beforeEach(function () {
+      sinon.stub(App.HostComponent, 'find').returns([
+        Em.Object.create({
+          id: 'C1_host1',
+          componentName: 'C1',
+          hostName: 'host1',
+          service: Em.Object.create({
+            serviceName: 'S1'
+          })
+        })
+      ]);
+      sinon.stub(App.serviceMapper, 'deleteRecord', Em.K);
+    });
+    afterEach(function () {
+      App.HostComponent.find.restore();
+      App.serviceMapper.deleteRecord.restore();
+    });
+    it("", function () {
+      App.cache['services'] = [
+        {
+          ServiceInfo: {
+            service_name: 'S1'
+          },
+          host_components: ['C1_host1']
+        }
+      ];
+      controller.removeHostComponentModel('C1', 'host1');
+      expect(App.cache['services'][0].host_components).to.be.empty;
+      expect(App.HostComponent.find.calledOnce).to.be.true;
+      expect(App.serviceMapper.deleteRecord.calledOnce).to.be.true;
+    });
+  });
+
+  describe("#updateStormConfigs()", function () {
+    beforeEach(function () {
+      this.serviceMock = sinon.stub(App.Service, 'find');
+      sinon.stub(controller, 'loadConfigs');
+      this.mock = sinon.stub(App, 'get')
+    });
+    afterEach(function () {
+      this.serviceMock.restore();
+      this.mock.restore();
+      controller.loadConfigs.restore();
+    });
+    it("storm not installed, hadoop stack is 2.2", function () {
+      this.serviceMock.returns(Em.Object.create({
+        isLoaded: false
+      }));
+      this.mock.returns(false);
+      controller.updateStormConfigs();
+      expect(controller.loadConfigs.called).to.be.false;
+    });
+    it("storm installed, hadoop stack is 2.2", function () {
+      this.serviceMock.returns(Em.Object.create({
+        isLoaded: true
+      }));
+      this.mock.returns(false);
+      controller.updateStormConfigs();
+      expect(controller.loadConfigs.called).to.be.false;
+    });
+    it("storm installed, hadoop stack is 2.3", function () {
+      this.serviceMock.returns(Em.Object.create({
+        isLoaded: true
+      }));
+      this.mock.returns(true);
+      controller.updateStormConfigs();
+      expect(controller.loadConfigs.calledWith('loadStormConfigs')).to.be.true;
+    });
+  });
 });