Author: yusaku
Date: Thu Jun 13 17:17:23 2013
New Revision: 1492769

URL: http://svn.apache.org/r1492769
Log:
AMBARI-2377. Add Host Wizard: show info about manual steps required on a secure 
cluster. (Oleg Nechiporenko via yusaku)

Modified:
    incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security.js
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/templates/wizard/step8.hbs

Modified: 
incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security.js?rev=1492769&r1=1492768&r2=1492769&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security.js 
(original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security.js 
Thu Jun 13 17:17:23 2013
@@ -46,7 +46,6 @@ App.MainAdminSecurityController = Em.Con
     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.Con
     }
   },
 
-  /**
-   * 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.Con
 
   showSecurityErrorPopup: function () {
     App.ModalPopup.show({
-      header: Em.I18n.translations['common.error'],
+      header: Em.I18n.t('common.error'),
       secondary: false,
       onPrimary: function () {
         this.hide();

Modified: 
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js?rev=1492769&r1=1492768&r2=1492769&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js 
Thu Jun 13 17:17:23 2013
@@ -32,6 +32,7 @@ App.WizardStep8Controller = Em.Controlle
   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.Controlle
 
   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.Controlle
    * 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.Controlle
       App.router.send('next');
     };
     this.doNextAjaxCall();
-
   },
 
   /**

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1492769&r1=1492768&r2=1492769&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Thu Jun 13 17:17:23 2013
@@ -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',
 

Modified: incubator/ambari/trunk/ambari-web/app/templates/wizard/step8.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/wizard/step8.hbs?rev=1492769&r1=1492768&r2=1492769&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/wizard/step8.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/wizard/step8.hbs Thu Jun 13 
17:17:23 2013
@@ -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/>


Reply via email to