Repository: ambari Updated Branches: refs/heads/trunk 955a66850 -> 3410ba4e1
Revert "AMBARI-11375. Hdfs, Yarn Hbase and other services ask required passwords for Ranger even if Ranger is not installed. (akovalenko)" Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3410ba4e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3410ba4e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3410ba4e Branch: refs/heads/trunk Commit: 3410ba4e12f0fdaf0ca6a49171716cfdf84128dd Parents: 955a668 Author: Aleksandr Kovalenko <[email protected]> Authored: Tue May 26 15:01:03 2015 +0300 Committer: Aleksandr Kovalenko <[email protected]> Committed: Tue May 26 15:01:03 2015 +0300 ---------------------------------------------------------------------- .../controllers/main/service/info/configs.js | 3 -- .../app/controllers/wizard/step7_controller.js | 4 --- ambari-web/app/utils/config.js | 23 -------------- .../test/controllers/wizard/step7_test.js | 14 --------- ambari-web/test/utils/config_test.js | 33 -------------------- 5 files changed, 77 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3410ba4e/ambari-web/app/controllers/main/service/info/configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js index 5c23c50..5e49ae8 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/ambari-web/app/controllers/main/service/info/configs.js @@ -844,9 +844,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM this.checkOverrideProperty(selectedService); this.checkDatabaseProperties(selectedService); this.checkForSecureConfig(this.get('selectedService')); - if (!App.Service.find().someProperty('serviceName', 'RANGER')) { - App.config.removeRangerConfigs(this.get('stepConfigs')); - } this.getRecommendationsForDependencies(null, true, function() { self.setProperties({ dataIsLoaded: true, http://git-wip-us.apache.org/repos/asf/ambari/blob/3410ba4e/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 47f69bd..b8771e5 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -647,10 +647,6 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E } }); - var rangerService = App.StackService.find().findProperty('serviceName', 'RANGER'); - if (!rangerService.get('isInstalled') && !rangerService.get('isSelected')) { - App.config.removeRangerConfigs(self.get('stepConfigs')); - } self.updateDependentConfigs(); self.checkHostOverrideInstaller(); self.activateSpecialConfigs(); http://git-wip-us.apache.org/repos/asf/ambari/blob/3410ba4e/ambari-web/app/utils/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js index e324cf5..976c251 100644 --- a/ambari-web/app/utils/config.js +++ b/ambari-web/app/utils/config.js @@ -1590,29 +1590,6 @@ App.config = Em.Object.create({ }); return !!matchingConfigType; } - }, - - /** - * Remove all ranger-related configs, that should be available only if Ranger is installed - * @param configs - stepConfigs object - */ - removeRangerConfigs: function (configs) { - configs.forEach(function (service) { - var filteredConfigs = []; - service.get('configs').forEach(function (config) { - if (!/^ranger-/.test(config.get('filename'))) { - filteredConfigs.push(config); - } - }); - service.set('configs', filteredConfigs); - var filteredCategories = []; - service.get('configCategories').forEach(function (category) { - if (!/ranger-/.test(category.get('name'))) { - filteredCategories.push(category); - } - }); - service.set('configCategories', filteredCategories); - }); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3410ba4e/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 bda32f5..acd3fbf 100644 --- a/ambari-web/test/controllers/wizard/step7_test.js +++ b/ambari-web/test/controllers/wizard/step7_test.js @@ -1464,19 +1464,6 @@ describe('App.InstallerStep7Controller', function () { sinon.stub(installerStep7Controller, 'selectProperService', Em.K); sinon.stub(installerStep7Controller, 'setStepConfigs', Em.K); sinon.stub(App.router, 'send', Em.K); - sinon.stub(App.StackService, 'find', function () { - return { - findProperty: function () { - return Em.Object.create({ - isInstalled: true, - isSelected: false - }); - }, - filterProperty: function () { - return []; - } - } - }); }); afterEach(function () { App.config.fileConfigsIntoTextarea.restore(); @@ -1487,7 +1474,6 @@ describe('App.InstallerStep7Controller', function () { installerStep7Controller.selectProperService.restore(); installerStep7Controller.setStepConfigs.restore(); App.router.send.restore(); - App.StackService.find.restore(); }); it('should run some methods' , function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/3410ba4e/ambari-web/test/utils/config_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js index 48e27d1..d382a60 100644 --- a/ambari-web/test/utils/config_test.js +++ b/ambari-web/test/utils/config_test.js @@ -1266,37 +1266,4 @@ describe('App.config', function () { }); - describe('#removeRangerConfigs', function () { - - it('should remove ranger configs and categories', function () { - var configs = [ - Em.Object.create({ - configs: [ - Em.Object.create({filename: 'filename'}), - Em.Object.create({filename: 'ranger-filename'}) - ], - configCategories: [ - Em.Object.create({name: 'ranger-name'}), - Em.Object.create({name: 'name'}), - Em.Object.create({name: 'also-ranger-name'}) - ] - }) - ]; - App.config.removeRangerConfigs(configs); - expect(configs).eql( - [ - Em.Object.create({ - configs: [ - Em.Object.create({filename: 'filename'}) - ], - configCategories: [ - Em.Object.create({name: 'name'}) - ] - }) - ] - ); - }); - - }); - });
