[05/40] ambari git commit: AMBARI-14884: Hawq standby host config should be removed on single node cluster during initial cluster installation (bhuvnesh2703 via jaoki)
AMBARI-14884: Hawq standby host config should be removed on single node cluster during initial cluster installation (bhuvnesh2703 via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4fbf172c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4fbf172c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4fbf172c Branch: refs/heads/branch-dev-patch-upgrade Commit: 4fbf172c31e65bab503ab8e0acbfefd2b7a3adbe Parents: 65558a5 Author: Jun AokiAuthored: Wed Feb 3 15:38:40 2016 -0800 Committer: Jun Aoki Committed: Wed Feb 3 15:38:40 2016 -0800 -- .../app/controllers/wizard/step7_controller.js | 2 +- .../test/controllers/wizard/step7_test.js | 20 ++-- 2 files changed, 7 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4fbf172c/ambari-web/app/controllers/wizard/step7_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index f6b6cb3..011833b 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -699,7 +699,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E if (App.get('isHaEnabled')) this.addHawqConfigsOnNnHa(configs); if (App.get('isRMHaEnabled')) this.addHawqConfigsOnRMHa(configs); } -if (App.get('isSingleNode')) this.removeHawqStandbyHostAddressConfig(configs); +if (Object.keys(this.get('content.hosts')).length === 1) this.removeHawqStandbyHostAddressConfig(configs); return configs }, http://git-wip-us.apache.org/repos/asf/ambari/blob/4fbf172c/ambari-web/test/controllers/wizard/step7_test.js -- diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js index d4dcb24..8a4a96f 100644 --- a/ambari-web/test/controllers/wizard/step7_test.js +++ b/ambari-web/test/controllers/wizard/step7_test.js @@ -1180,8 +1180,10 @@ describe('App.InstallerStep7Controller', function () { }); - describe('#updateHawqConfigs', function() { -var isSingleNode = false; + describe('#removeHawqStandbyHostAddressConfig', function() { +installerStep7Controller = App.WizardStep7Controller.create({ + content: Em.Object.create({}), +}); var testHawqSiteConfigs = [ { name: 'hawq_standby_address_host', @@ -1194,19 +1196,9 @@ describe('App.InstallerStep7Controller', function () { ]; var oldHawqSiteLength = testHawqSiteConfigs.length; -beforeEach(function () { - sinon.stub(App, 'get', function () { -return isSingleNode; - }); -}); - -afterEach(function () { - App.get.restore() -}); - it('hawq_standby_address_host should be removed on single node cluster', function() { - isSingleNode = true; var hawqSiteConfigs = testHawqSiteConfigs.slice(); + installerStep7Controller.set('content.hosts', {'hostname': 'h1'}); var updatedHawqSiteConfigs = installerStep7Controller.updateHawqConfigs(hawqSiteConfigs); expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength-1); expect(updatedHawqSiteConfigs.findProperty('name', 'hawq_standby_address_host')).to.not.exist; @@ -1214,8 +1206,8 @@ describe('App.InstallerStep7Controller', function () { }); it('hawq_standby_address_host should not be removed on multi node clusters', function() { - isSingleNode = false; var hawqSiteConfigs = testHawqSiteConfigs.slice(); + installerStep7Controller.set('content.hosts', Em.A([{'hostname': 'h1'}, {'hostname': 'h2'}])); var updatedHawqSiteConfigs = installerStep7Controller.updateHawqConfigs(hawqSiteConfigs); expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength); expect(updatedHawqSiteConfigs.findProperty('name', 'hawq_standby_address_host').value).to.be.equal('h2');
ambari git commit: AMBARI-14884: Hawq standby host config should be removed on single node cluster during initial cluster installation (bhuvnesh2703 via jaoki)
Repository: ambari Updated Branches: refs/heads/branch-2.2 8b620a3c3 -> 16ff8f30a AMBARI-14884: Hawq standby host config should be removed on single node cluster during initial cluster installation (bhuvnesh2703 via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/16ff8f30 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/16ff8f30 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/16ff8f30 Branch: refs/heads/branch-2.2 Commit: 16ff8f30a9108a904ebd656ebe7b162b6c3c258d Parents: 8b620a3 Author: Jun AokiAuthored: Wed Feb 3 15:41:31 2016 -0800 Committer: Jun Aoki Committed: Wed Feb 3 15:41:31 2016 -0800 -- ambari-web/app/controllers/wizard/step7_controller.js | 3 ++- ambari-web/test/controllers/wizard/step7_test.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/16ff8f30/ambari-web/app/controllers/wizard/step7_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index 4b27c76..a38222a 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -724,7 +724,8 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E } } } -if (App.get('isSingleNode')) this.removeHawqStandbyHostAddressConfig(configs); +// On single node cluster, update hawq configs +if (Object.keys(this.get('content.hosts')).length === 1) this.removeHawqStandbyHostAddressConfig(configs); var dependedServices = ["STORM", "YARN"]; dependedServices.forEach(function (serviceName) { if (this.get('allSelectedServiceNames').contains(serviceName)) { http://git-wip-us.apache.org/repos/asf/ambari/blob/16ff8f30/ambari-web/test/controllers/wizard/step7_test.js -- diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js index 408a43e..79f0202 100644 --- a/ambari-web/test/controllers/wizard/step7_test.js +++ b/ambari-web/test/controllers/wizard/step7_test.js @@ -1476,6 +1476,7 @@ describe('App.InstallerStep7Controller', function () { } } }); + installerStep7Controller.set('content.hosts', Em.A([{hostName: 'h1'}, {hostName: 'h2'}])); }); afterEach(function () { App.config.fileConfigsIntoTextarea.restore();
ambari git commit: AMBARI-14884: Hawq standby host config should be removed on single node cluster during initial cluster installation (bhuvnesh2703 via jaoki)
Repository: ambari Updated Branches: refs/heads/trunk 65558a5a6 -> 4fbf172c3 AMBARI-14884: Hawq standby host config should be removed on single node cluster during initial cluster installation (bhuvnesh2703 via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4fbf172c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4fbf172c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4fbf172c Branch: refs/heads/trunk Commit: 4fbf172c31e65bab503ab8e0acbfefd2b7a3adbe Parents: 65558a5 Author: Jun AokiAuthored: Wed Feb 3 15:38:40 2016 -0800 Committer: Jun Aoki Committed: Wed Feb 3 15:38:40 2016 -0800 -- .../app/controllers/wizard/step7_controller.js | 2 +- .../test/controllers/wizard/step7_test.js | 20 ++-- 2 files changed, 7 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4fbf172c/ambari-web/app/controllers/wizard/step7_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index f6b6cb3..011833b 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -699,7 +699,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E if (App.get('isHaEnabled')) this.addHawqConfigsOnNnHa(configs); if (App.get('isRMHaEnabled')) this.addHawqConfigsOnRMHa(configs); } -if (App.get('isSingleNode')) this.removeHawqStandbyHostAddressConfig(configs); +if (Object.keys(this.get('content.hosts')).length === 1) this.removeHawqStandbyHostAddressConfig(configs); return configs }, http://git-wip-us.apache.org/repos/asf/ambari/blob/4fbf172c/ambari-web/test/controllers/wizard/step7_test.js -- diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js index d4dcb24..8a4a96f 100644 --- a/ambari-web/test/controllers/wizard/step7_test.js +++ b/ambari-web/test/controllers/wizard/step7_test.js @@ -1180,8 +1180,10 @@ describe('App.InstallerStep7Controller', function () { }); - describe('#updateHawqConfigs', function() { -var isSingleNode = false; + describe('#removeHawqStandbyHostAddressConfig', function() { +installerStep7Controller = App.WizardStep7Controller.create({ + content: Em.Object.create({}), +}); var testHawqSiteConfigs = [ { name: 'hawq_standby_address_host', @@ -1194,19 +1196,9 @@ describe('App.InstallerStep7Controller', function () { ]; var oldHawqSiteLength = testHawqSiteConfigs.length; -beforeEach(function () { - sinon.stub(App, 'get', function () { -return isSingleNode; - }); -}); - -afterEach(function () { - App.get.restore() -}); - it('hawq_standby_address_host should be removed on single node cluster', function() { - isSingleNode = true; var hawqSiteConfigs = testHawqSiteConfigs.slice(); + installerStep7Controller.set('content.hosts', {'hostname': 'h1'}); var updatedHawqSiteConfigs = installerStep7Controller.updateHawqConfigs(hawqSiteConfigs); expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength-1); expect(updatedHawqSiteConfigs.findProperty('name', 'hawq_standby_address_host')).to.not.exist; @@ -1214,8 +1206,8 @@ describe('App.InstallerStep7Controller', function () { }); it('hawq_standby_address_host should not be removed on multi node clusters', function() { - isSingleNode = false; var hawqSiteConfigs = testHawqSiteConfigs.slice(); + installerStep7Controller.set('content.hosts', Em.A([{'hostname': 'h1'}, {'hostname': 'h2'}])); var updatedHawqSiteConfigs = installerStep7Controller.updateHawqConfigs(hawqSiteConfigs); expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength); expect(updatedHawqSiteConfigs.findProperty('name', 'hawq_standby_address_host').value).to.be.equal('h2');