Pārlūkot izejas kodu

AMBARI-2696: Confirmation pop up for Disable security should ask user to move directories listed in mapred.local.dirs. (jaimin)

Jaimin Jetly 12 gadi atpakaļ
vecāks
revīzija
0f6a98c7a3

+ 25 - 9
ambari-web/app/controllers/main/admin/security.js

@@ -34,7 +34,7 @@ App.MainAdminSecurityController = Em.Controller.extend({
   setDisableSecurityStatus: function (status) {
     App.db.setDisableSecurityStatus(status);
   },
-  getDisableSecurityStatus: function(status) {
+  getDisableSecurityStatus: function (status) {
     return App.db.getDisableSecurityStatus();
   },
 
@@ -44,15 +44,31 @@ App.MainAdminSecurityController = Em.Controller.extend({
   notifySecurityOffPopup: function () {
     var self = this;
     if (!this.get('isSubmitDisabled')) {
-      App.showConfirmationPopup(function () {
-        App.db.setSecurityDeployStages(undefined);
-        self.setDisableSecurityStatus("RUNNING");
-        App.router.transitionTo('disableSecurity');
-      }, Em.I18n.t('admin.security.disable.popup.body'));
+      App.ModalPopup.show({
+        header: Em.I18n.t('popup.confirmation.commonHeader'),
+        primary: Em.I18n.t('ok'),
+        onPrimary: function () {
+          App.db.setSecurityDeployStages(undefined);
+          self.setDisableSecurityStatus("RUNNING");
+          App.router.transitionTo('disableSecurity');
+        },
+        bodyClass: Ember.View.extend({
+          isMapReduceInstalled: App.Service.find().mapProperty('serviceName').contains('MAPREDUCE'),
+          template: Ember.Handlebars.compile([
+            '<div class="alert">',
+            '{{t admin.security.disable.popup.body}}',
+            '{{#if view.isMapReduceInstalled}}',
+            '<br>',
+            '{{t admin.security.disable.popup.body.warning}}',
+            '{{/if}}',
+            '</div>'
+          ].join('\n'))
+        })
+      })
     }
   },
 
-  getUpdatedSecurityStatus: function() {
+  getUpdatedSecurityStatus: function () {
     this.setSecurityStatus();
     return this.get('securityEnabled');
   },
@@ -72,7 +88,7 @@ App.MainAdminSecurityController = Em.Controller.extend({
     }
   },
 
-  errorCallback: function() {
+  errorCallback: function () {
     this.set('dataIsLoaded', true);
     this.showSecurityErrorPopup();
   },
@@ -104,7 +120,7 @@ App.MainAdminSecurityController = Em.Controller.extend({
   getServiceConfigsFromServerSuccessCallback: function (data) {
     console.log("TRACE: In success function for the GET getServiceConfigsFromServer call");
     var configs = data.items.findProperty('tag', this.get('tag')).properties;
-    if (configs && (configs['security_enabled'] === 'true'  ||configs['security_enabled'] === true)) {
+    if (configs && (configs['security_enabled'] === 'true' || configs['security_enabled'] === true)) {
       this.set('securityEnabled', true);
     }
     else {

+ 1 - 0
ambari-web/app/messages.js

@@ -637,6 +637,7 @@ Em.I18n.translations = {
   'admin.security.enable.popup.header': 'Add security',
   'admin.security.disable.popup.header': 'Remove security',
   'admin.security.disable.popup.body': 'Kerberos security will be disabled on the cluster',
+  'admin.security.disable.popup.body.warning' : 'Note: Before proceeding, you need to manually remove all directories listed in the mapred.local.dir property in mapred-site.xml on all TaskTracker hosts; otherwise, MapReduce will not run properly after disabling security.',
   'admin.addSecurity.header': 'Enable Security Wizard',
   'admin.security.step1.header': 'Get Started',
   'admin.security.step2.header': 'Configure Services',