Переглянути джерело

AMBARI-2377. Add Host Wizard: show info about manual steps required on a secure cluster. (Oleg Nechiporenko via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1492769 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 роки тому
батько
коміт
70c7852b7b

+ 6 - 5
ambari-web/app/controllers/main/admin/security.js

@@ -46,7 +46,6 @@ App.MainAdminSecurityController = Em.Controller.extend({
     if (!this.get('isSubmitDisabled')) {
       App.ModalPopup.show({
         header: Em.I18n.t('admin.security.disable.popup.header'),
-        primary: 'OK',
         secondary: null,
         onPrimary: function () {
           App.db.setSecurityDeployStages(undefined);
@@ -61,9 +60,11 @@ App.MainAdminSecurityController = Em.Controller.extend({
     }
   },
 
-  /**
-   * return true if security status is loaded and false otherwise
-   */
+  getUpdatedSecurityStatus: function() {
+    this.setSecurityStatus();
+    return this.get('securityEnabled');
+  },
+
   setSecurityStatus: function () {
     if (App.testMode) {
       this.set('securityEnabled', !App.testEnableSecurity);
@@ -147,7 +148,7 @@ App.MainAdminSecurityController = Em.Controller.extend({
 
   showSecurityErrorPopup: function () {
     App.ModalPopup.show({
-      header: Em.I18n.translations['common.error'],
+      header: Em.I18n.t('common.error'),
       secondary: false,
       onPrimary: function () {
         this.hide();

+ 15 - 2
ambari-web/app/controllers/wizard/step8_controller.js

@@ -32,6 +32,7 @@ App.WizardStep8Controller = Em.Controller.extend({
   isSubmitDisabled: false,
   hasErrorOccurred: false,
   servicesInstalled: false,
+  securityEnabled: false,
   /**
    * During page save time, we set the host overrides to the server.
    * The new host -> site:tag map is stored below. This will be
@@ -72,6 +73,9 @@ App.WizardStep8Controller = Em.Controller.extend({
 
   loadStep: function () {
     console.log("TRACE: Loading step8: Review Page");
+    if (this.get('content.controllerName') != 'installerController') {
+      this.set('securityEnabled', App.router.get('mainAdminSecurityController').getUpdatedSecurityStatus());
+    }
     this.clearStep();
     this.loadGlobals();
     this.loadConfigs();
@@ -851,11 +855,21 @@ App.WizardStep8Controller = Em.Controller.extend({
    * Onclick handler for <code>next</code> button
    */
   submit: function () {
-
     if (this.get('isSubmitDisabled')) {
       return;
     }
+    if ((this.get('content.controllerName') == 'addHostController') && this.get('securityEnabled')) {
+      var self = this;
+      App.showConfirmationPopup(function() {
+        self.submitProceed();
+      }, Em.I18n.t('installer.step8.securityConfirmationPopupBody'));
+    }
+    else {
+      this.submitProceed();
+    }
+  },
 
+  submitProceed: function() {
     this.set('isSubmitDisabled', true);
 
     // checkpoint the cluster status on the server so that the user can resume from where they left off
@@ -907,7 +921,6 @@ App.WizardStep8Controller = Em.Controller.extend({
       App.router.send('next');
     };
     this.doNextAjaxCall();
-
   },
 
   /**

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

@@ -386,6 +386,8 @@ Em.I18n.translations = {
   'installer.step8.hosts':' hosts',
   'installer.step8.host':' host',
   'installer.step8.other':' and {0} other hosts',
+  'installer.step8.securityWarning':'You are running your cluster in secure mode. You must set up the keytabs for all the hosts you are adding before you proceed.',
+  'installer.step8.securityConfirmationPopupBody':'Before you proceed, please make sure that the keytabs have been set up on the hosts you are adding per the instructions on the Review page. Otherwise, the assigned components will not be able to start properly on the hosts being added.',
 
   'installer.step9.header':'Install, Start and Test',
   'installer.step9.body':'Please wait while the selected services are installed and started.',
@@ -900,6 +902,7 @@ Em.I18n.translations = {
   'host.host.componentFilter.slave':'Slave Components',
   'host.host.componentFilter.client':'Client Components',
   'hosts.host.addComponent.note':'Note: After this component is installed, go to Services -> Nagios to restart the Nagios service.  This is required for the alerts and notifications to work properly.',
+  'hosts.host.addComponent.securityNote':'You are running your cluster in secure mode. You must set up the keytab for {0} on {1} before you proceed. Otherwise, the component will not be able to start properly.',
   'hosts.host.datanode.decommission':'Decommission DataNode',
   'hosts.host.datanode.recommission':'Recommission DataNode',
 

+ 6 - 0
ambari-web/app/templates/wizard/step8.hbs

@@ -22,6 +22,12 @@
   {{t installer.step8.body}}
 </div>
 
+{{#if controller.securityEnabled}}
+  <div class="alert alert-error">
+    {{t installer.step8.securityWarning}}
+  </div>
+{{/if}}
+
 <div id="step8-content" class="well pre-scrollable">
     <div id="printReview">
         <a class="btn btn-info pull-right" {{action printReview target="view"}}>{{t common.print}}</a> <br/>