Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 32943200C0D for ; Tue, 31 Jan 2017 20:54:02 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 31571160B52; Tue, 31 Jan 2017 19:54:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 565E3160B36 for ; Tue, 31 Jan 2017 20:54:01 +0100 (CET) Received: (qmail 83261 invoked by uid 500); 31 Jan 2017 19:54:00 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 83252 invoked by uid 99); 31 Jan 2017 19:54:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jan 2017 19:54:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7194ADFD71; Tue, 31 Jan 2017 19:54:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jaimin@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-19785. Need to have a flag from UI to show/hide ranger plugin configs. (jaimin) Date: Tue, 31 Jan 2017 19:54:00 +0000 (UTC) archived-at: Tue, 31 Jan 2017 19:54:02 -0000 Repository: ambari Updated Branches: refs/heads/trunk 772c09307 -> e5c5c6b11 AMBARI-19785. Need to have a flag from UI to show/hide ranger plugin configs. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e5c5c6b1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e5c5c6b1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e5c5c6b1 Branch: refs/heads/trunk Commit: e5c5c6b111b3a1a215f5c457e0e1038d6d369a13 Parents: 772c093 Author: Jaimin Jetly Authored: Tue Jan 31 11:53:48 2017 -0800 Committer: Jaimin Jetly Committed: Tue Jan 31 11:53:48 2017 -0800 ---------------------------------------------------------------------- .../HDP/2.0.6/configuration/cluster-env.xml | 6 +++ .../controllers/main/service/info/configs.js | 24 +++++++++--- .../app/controllers/wizard/step7_controller.js | 41 ++++++++++++++++---- 3 files changed, 59 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/e5c5c6b1/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml index 93680bf..3af8f08 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml @@ -290,4 +290,10 @@ gpgcheck=0 true + + enable_external_ranger + false + Flag to turn on when external setup of External Ranger is done. + + http://git-wip-us.apache.org/repos/asf/ambari/blob/e5c5c6b1/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 d946ea0..319610c 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/ambari-web/app/controllers/main/service/info/configs.js @@ -514,14 +514,28 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.AddSecurityConfi var selectedService = this.get('stepConfigs').findProperty('serviceName', this.get('content.serviceName')); this.set('selectedService', selectedService); this.checkOverrideProperty(selectedService); - /* if (App.Service.find().someProperty('serviceName', 'RANGER')) { + + var isRangerPresent = App.Service.find().someProperty('serviceName', 'RANGER'); + if (isRangerPresent) { App.router.get('mainServiceInfoSummaryController').updateRangerPluginsStatus(); this.setVisibilityForRangerProperties(selectedService); + this.loadConfigRecommendations(null, this._onLoadComplete.bind(this)); + App.loadTimer.finish('Service Configs Page'); } else { - App.config.removeRangerConfigs(this.get('stepConfigs')); - } */ - this.loadConfigRecommendations(null, this._onLoadComplete.bind(this)); - App.loadTimer.finish('Service Configs Page'); + var mainController = App.get('router.mainController'); + var clusterController = App.get('router.clusterController'); + var self = this; + mainController.isLoading.call(clusterController, 'clusterEnv').done(function () { + var isExternalRangerSetup = clusterController.get("clusterEnv")["properties"]["enable_external_ranger"]; + if (isExternalRangerSetup) { + self.setVisibilityForRangerProperties(selectedService); + } else { + App.config.removeRangerConfigs(self.get('stepConfigs')); + } + self.loadConfigRecommendations(null, self._onLoadComplete.bind(self)); + App.loadTimer.finish('Service Configs Page'); + }); + } }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/e5c5c6b1/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 7dcc2ad..1d24ee3 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -535,13 +535,40 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E this.set('stepConfigs', serviceConfigs); this.checkHostOverrideInstaller(); this.selectProperService(); - /* var rangerService = App.StackService.find().findProperty('serviceName', 'RANGER'); - if (rangerService && !rangerService.get('isInstalled') && !rangerService.get('isSelected')) { - App.config.removeRangerConfigs(this.get('stepConfigs')); - } */ - console.timeEnd('applyServicesConfigs execution time: '); - console.time('loadConfigRecommendations execution time: '); - this.loadConfigRecommendations(null, this.completeConfigLoading.bind(this)); + var isInstallerWizard = (this.get("content.controllerName") === 'installerController'); + var self = this; + var rangerService = App.StackService.find().findProperty('serviceName', 'RANGER'); + var isRangerServiceAbsent = rangerService && !rangerService.get('isInstalled') && !rangerService.get('isSelected'); + if (isRangerServiceAbsent) { + var isExternalRangerSetup; + if (isInstallerWizard) { + isExternalRangerSetup = configs.filterProperty('fileName','cluster-env.xml').findProperty('name','enable_external_ranger'); + if (Em.isNone(isExternalRangerSetup) || isExternalRangerSetup.value !== "true") { + App.config.removeRangerConfigs(this.get('stepConfigs')); + } + console.timeEnd('applyServicesConfigs execution time: '); + console.time('loadConfigRecommendations execution time: '); + self.loadConfigRecommendations(null, self.completeConfigLoading.bind(self)); + } else { + var mainController = App.get('router.mainController'); + var clusterController = App.get('router.clusterController'); + mainController.isLoading.call(clusterController, 'clusterEnv').done(function () { + isExternalRangerSetup = clusterController.get("clusterEnv")["properties"]["enable_external_ranger"]; + if (isExternalRangerSetup !== "true") { + App.config.removeRangerConfigs(self.get('stepConfigs')); + } + console.timeEnd('applyServicesConfigs execution time: '); + console.time('loadConfigRecommendations execution time: '); + self.loadConfigRecommendations(null, self.completeConfigLoading.bind(self)); + }); + } + + } else { + console.timeEnd('applyServicesConfigs execution time: '); + console.time('loadConfigRecommendations execution time: '); + self.loadConfigRecommendations(null, self.completeConfigLoading.bind(self)); + } + }, /**