Repository: ambari Updated Branches: refs/heads/trunk 254280c3c -> d45f38641
AMBARI-8735. Preparing to deploy issue for 1.3 stack. (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a840c24d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a840c24d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a840c24d Branch: refs/heads/trunk Commit: a840c24d5e18219e5063152287f9d03a8fef3d16 Parents: 828dc79 Author: Oleg Nechiporenko <onechipore...@apache.org> Authored: Tue Dec 16 19:35:12 2014 +0200 Committer: Oleg Nechiporenko <onechipore...@apache.org> Committed: Tue Dec 16 19:35:12 2014 +0200 ---------------------------------------------------------------------- .../app/controllers/wizard/step7_controller.js | 4 +- .../app/controllers/wizard/step8_controller.js | 4 +- .../app/views/common/configs/services_config.js | 4 ++ .../test/controllers/wizard/step7_test.js | 1 + .../test/controllers/wizard/step8_test.js | 39 +++++++++++++++++--- 5 files changed, 42 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a840c24d/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 7953fab..a27f780 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -721,8 +721,8 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, { serviceConfigs.findProperty('serviceName', 'HDFS').configs = c; } - // Remove Notifications from MISC if it isn't Installer Controller - if (this.get('wizardController.name') !== 'installerController') { + // Remove Notifications from MISC if it isn't Installer Controller or stack is < 2.0 + if (this.get('wizardController.name') !== 'installerController' || !App.get('isHadoop2Stack')) { var miscService = serviceConfigs.findProperty('serviceName', 'MISC'); if (miscService) { c = miscService.configs; http://git-wip-us.apache.org/repos/asf/ambari/blob/a840c24d/ambari-web/app/controllers/wizard/step8_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js index 541eeb5..1ad91d0 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -1827,11 +1827,11 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz /** * Create one Alert Notification (if user select this on step7) - * Only for Install Wizard! + * Only for Install Wizard and stack >= 2! * @method createNotification */ createNotification: function () { - if (this.get('content.controllerName') !== 'installerController') return; + if (this.get('content.controllerName') !== 'installerController' || !App.get('isHadoop2Stack')) return; var miscConfigs = this.get('configs').filterProperty('serviceName', 'MISC'), createNotification = miscConfigs.findProperty('name', 'create_notification').value; if (createNotification === 'yes') { http://git-wip-us.apache.org/repos/asf/ambari/blob/a840c24d/ambari-web/app/views/common/configs/services_config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/services_config.js b/ambari-web/app/views/common/configs/services_config.js index a21b307..4945916 100644 --- a/ambari-web/app/views/common/configs/services_config.js +++ b/ambari-web/app/views/common/configs/services_config.js @@ -801,6 +801,10 @@ App.ServiceConfigContainerView = Em.ContainerView.extend({ } var categoriesToPush = []; this.get('controller.selectedService.configCategories').forEach(function (item) { + + // stack 1.3 doesn't need customView + if (!App.get('isHadoop2Stack') && item.get('isCustomView')) return; + var categoryView = item.get('isCustomView') ? item.get('customView') : App.ServiceConfigsByCategoryView; if (categoryView !== null) { categoriesToPush.pushObject(categoryView.extend({ http://git-wip-us.apache.org/repos/asf/ambari/blob/a840c24d/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 510917c..1350dd1 100644 --- a/ambari-web/test/controllers/wizard/step7_test.js +++ b/ambari-web/test/controllers/wizard/step7_test.js @@ -1107,6 +1107,7 @@ describe('App.InstallerStep7Controller', function () { }); }); }); + describe('#_updateValueForCheckBoxConfig', function () { Em.A([ { http://git-wip-us.apache.org/repos/asf/ambari/blob/a840c24d/ambari-web/test/controllers/wizard/step8_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js index 4da0ff0..410d0b1 100644 --- a/ambari-web/test/controllers/wizard/step8_test.js +++ b/ambari-web/test/controllers/wizard/step8_test.js @@ -905,7 +905,6 @@ describe('App.WizardStep8Controller', function () { }); }); - describe('#createStormSiteObj', function() { it('should replace quote \'"\' to "\'" for some properties', function() { var configs = [ @@ -1058,10 +1057,6 @@ describe('App.WizardStep8Controller', function () { }); }); - describe('#formatProperties', function() { - - }); - describe('#applyInstalledServicesConfigurationGroup', function() { beforeEach(function() { sinon.stub($, 'ajax', Em.K); @@ -1297,7 +1292,6 @@ describe('App.WizardStep8Controller', function () { }); - describe('#createAdditionalHostComponents', function() { beforeEach(function() { @@ -1402,6 +1396,39 @@ describe('App.WizardStep8Controller', function () { }); + describe('#createNotification', function () { + + beforeEach(function () { + installerStep8Controller.set('content', {controllerName: 'installerController'}); + installerStep8Controller.set('ajaxRequestsQueue', App.ajaxQueue.create()); + installerStep8Controller.set('configs', [ + {name: 'create_notification', value: 'yes', serviceName: 'MISC'}, + {name: 'ambari.dispatch.recipients', value: 'to@f.c', serviceName: 'MISC'}, + {name: 'mail.smtp.host', value: 'h', serviceName: 'MISC'}, + {name: 'mail.smtp.port', value: '25', serviceName: 'MISC'}, + {name: 'mail.smtp.from', value: 'from@f.c', serviceName: 'MISC'}, + {name: 'mail.smtp.starttls.enable', value: true, serviceName: 'MISC'}, + {name: 'mail.smtp.startssl.enable', value: false, serviceName: 'MISC'}, + {name: 'smtp_use_auth', value: 'false', serviceName: 'MISC'}, + ]); + sinon.stub(App, 'get', function (k) { + if ('isHadoop2Stack' === k) return true; + return Em.get(App, k); + }); + }); + + afterEach(function () { + App.get.restore(); + }); + + it('should add request to queue', function () { + + installerStep8Controller.createNotification(); + expect(installerStep8Controller.get('ajaxRequestsQueue.queue.length')).to.equal(1); + + }); + + }); });