Repository: ambari Updated Branches: refs/heads/branch-2.1 31dddf695 -> 70fd78830
AMBARI-12590 Redundant nimbus.seeds config merge warning among pre-upgrade check results. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/70fd7883 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/70fd7883 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/70fd7883 Branch: refs/heads/branch-2.1 Commit: 70fd788300a14c3d0f54b4b4d80251d5034b21b9 Parents: 31dddf6 Author: Andrii Tkach <[email protected]> Authored: Thu Jul 30 15:08:04 2015 +0300 Committer: Andrii Tkach <[email protected]> Committed: Thu Jul 30 18:22:53 2015 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/main/host/details.js | 2 +- ambari-web/app/data/HDP2.3/site_properties.js | 11 +++ ambari-web/app/data/HDP2/site_properties.js | 11 --- .../test/controllers/main/host/details_test.js | 71 ++++++++++++++++++++ 4 files changed, 83 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/70fd7883/ambari-web/app/controllers/main/host/details.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js index 23b92a3..641ab3b 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -1045,7 +1045,7 @@ App.MainHostDetailsController = Em.Controller.extend({ * @method updateStormConfigs */ updateStormConfigs: function () { - if (App.Service.find().findProperty('serviceName', 'STORM')) { + if (App.Service.find('STORM').get('isLoaded') && App.get('isHadoop23Stack')) { this.loadConfigs("loadStormConfigs"); } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/70fd7883/ambari-web/app/data/HDP2.3/site_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2.3/site_properties.js b/ambari-web/app/data/HDP2.3/site_properties.js index 5e2b2c1..152d58d 100644 --- a/ambari-web/app/data/HDP2.3/site_properties.js +++ b/ambari-web/app/data/HDP2.3/site_properties.js @@ -395,6 +395,17 @@ hdp23properties.push({ }, { "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", "displayName": "Audit to DB", "displayType": "checkbox", http://git-wip-us.apache.org/repos/asf/ambari/blob/70fd7883/ambari-web/app/data/HDP2/site_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js index e359a41..5989b50 100644 --- a/ambari-web/app/data/HDP2/site_properties.js +++ b/ambari-web/app/data/HDP2/site_properties.js @@ -1060,17 +1060,6 @@ var hdp2properties = [ }, { "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", "displayName": "nimbus.thrift.port", "displayType": "int", http://git-wip-us.apache.org/repos/asf/ambari/blob/70fd7883/ambari-web/test/controllers/main/host/details_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js index 5a6bbe0..76d1835 100644 --- a/ambari-web/test/controllers/main/host/details_test.js +++ b/ambari-web/test/controllers/main/host/details_test.js @@ -2805,4 +2805,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; + }); + }); });
