Browse Source

AMBARI-9065 Remove the code to disallow the user from proceeding with HA Wizard if Kerberos is already enabled. (ababiichuk)

aBabiichuk 10 years ago
parent
commit
c87fa43bec

+ 13 - 22
ambari-web/app/controllers/main/admin/highAvailability_controller.js

@@ -21,10 +21,6 @@ var App = require('app');
 App.MainAdminHighAvailabilityController = Em.Controller.extend({
 App.MainAdminHighAvailabilityController = Em.Controller.extend({
   name: 'mainAdminHighAvailabilityController',
   name: 'mainAdminHighAvailabilityController',
 
 
-  securityEnabled: function () {
-    return App.router.get('mainAdminSecurityController.securityEnabled');
-  }.property('App.router.mainAdminSecurityController.securityEnabled'),
-
   tag: null,
   tag: null,
 
 
   dataIsLoaded: false,
   dataIsLoaded: false,
@@ -36,25 +32,20 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({
   enableHighAvailability: function () {
   enableHighAvailability: function () {
     var message = [];
     var message = [];
     var hostComponents = App.HostComponent.find();
     var hostComponents = App.HostComponent.find();
-    //Prerequisite Checks
-    if (this.get('securityEnabled')) {
-      this.showErrorPopup(Em.I18n.t('admin.highAvailability.error.security'));
-      return false;
-    } else {
-      if (hostComponents.findProperty('componentName', 'NAMENODE').get('workStatus') !== 'STARTED') {
-        message.push(Em.I18n.t('admin.highAvailability.error.namenodeStarted'));
-      }
-      if (hostComponents.filterProperty('componentName', 'ZOOKEEPER_SERVER').length < 3) {
-        message.push(Em.I18n.t('admin.highAvailability.error.zooKeeperNum'));
-      }
 
 
-      if (App.router.get('mainHostController.hostsCountMap.TOTAL') < 3) {
-        message.push(Em.I18n.t('admin.highAvailability.error.hostsNum'));
-      }
-      if (message.length > 0) {
-        this.showErrorPopup(message);
-        return false;
-      }
+    if (hostComponents.findProperty('componentName', 'NAMENODE').get('workStatus') !== 'STARTED') {
+      message.push(Em.I18n.t('admin.highAvailability.error.namenodeStarted'));
+    }
+    if (hostComponents.filterProperty('componentName', 'ZOOKEEPER_SERVER').length < 3) {
+      message.push(Em.I18n.t('admin.highAvailability.error.zooKeeperNum'));
+    }
+
+    if (App.router.get('mainHostController.hostsCountMap.TOTAL') < 3) {
+      message.push(Em.I18n.t('admin.highAvailability.error.hostsNum'));
+    }
+    if (message.length > 0) {
+      this.showErrorPopup(message);
+      return false;
     }
     }
     App.router.transitionTo('main.services.enableHighAvailability');
     App.router.transitionTo('main.services.enableHighAvailability');
     return true;
     return true;

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

@@ -1017,7 +1017,6 @@ Em.I18n.translations = {
   'admin.highAvailability.error.hostsNum':'You must have at least 3 hosts in your cluster to enable NameNode HA.',
   'admin.highAvailability.error.hostsNum':'You must have at least 3 hosts in your cluster to enable NameNode HA.',
   'admin.highAvailability.error.namenodeStarted':'NameNode must be running before you enable NameNode HA.',
   'admin.highAvailability.error.namenodeStarted':'NameNode must be running before you enable NameNode HA.',
   'admin.highAvailability.error.zooKeeperNum':'You must have at least 3 ZooKeeper Servers in your cluster to enable NameNode HA.',
   'admin.highAvailability.error.zooKeeperNum':'You must have at least 3 ZooKeeper Servers in your cluster to enable NameNode HA.',
-  'admin.highAvailability.error.security':'You cannot enable NameNode HA via this wizard as your cluster is already secured.  First, disable security by going to Admin > Security, and then run this Enable NameNode HA wizard again.  After NameNode HA is enabled, you can go back to Admin > Security to secure the cluster.',
   'admin.rm_highAvailability.error.hostsNum':'You must have at least 3 hosts in your cluster to enable ResourceManager HA.',
   'admin.rm_highAvailability.error.hostsNum':'You must have at least 3 hosts in your cluster to enable ResourceManager HA.',
   'admin.rm_highAvailability.error.zooKeeperNum':'You must have at least 3 ZooKeeper Servers in your cluster to enable ResourceManager HA.',
   'admin.rm_highAvailability.error.zooKeeperNum':'You must have at least 3 ZooKeeper Servers in your cluster to enable ResourceManager HA.',
   'admin.rm_highAvailability.closePopup':'Enable ResourceManager HA Wizard is in progress. You must allow the wizard to complete for Ambari to be in usable state. If you choose to quit, you must follow manual instructions to complete or revert enabling ResourceManager HA as documented in the Ambari User Guide. Are you sure you want to exit the wizard?',
   'admin.rm_highAvailability.closePopup':'Enable ResourceManager HA Wizard is in progress. You must allow the wizard to complete for Ambari to be in usable state. If you choose to quit, you must follow manual instructions to complete or revert enabling ResourceManager HA as documented in the Ambari User Guide. Are you sure you want to exit the wizard?',

+ 0 - 24
ambari-web/test/controllers/main/admin/highAvailability_controller_test.js

@@ -44,20 +44,7 @@ describe('App.MainAdminHighAvailabilityController', function () {
       App.HostComponent.find.restore();
       App.HostComponent.find.restore();
     });
     });
 
 
-    it('Security enabled', function () {
-      sinon.stub(controller, 'get', function (k) {
-        if (k === 'securityEnabled') return true;
-        return Em.get(controller, k);
-      });
-      expect(controller.enableHighAvailability()).to.be.false;
-      expect(controller.showErrorPopup.calledOnce).to.be.true;
-      controller.get.restore();
-    });
     it('NAMENODE in INSTALLED state', function () {
     it('NAMENODE in INSTALLED state', function () {
-      sinon.stub(controller, 'get', function (k) {
-        if (k === 'securityEnabled') return false;
-        return Em.get(controller, k);
-      });
       hostComponents = [
       hostComponents = [
         Em.Object.create({
         Em.Object.create({
           componentName: 'NAMENODE',
           componentName: 'NAMENODE',
@@ -83,7 +70,6 @@ describe('App.MainAdminHighAvailabilityController', function () {
       expect(controller.enableHighAvailability()).to.be.false;
       expect(controller.enableHighAvailability()).to.be.false;
       expect(controller.showErrorPopup.calledOnce).to.be.true;
       expect(controller.showErrorPopup.calledOnce).to.be.true;
       App.router.get.restore();
       App.router.get.restore();
-      controller.get.restore();
     });
     });
     it('Cluster has less than 3 ZOOKEPER_SERVER components', function () {
     it('Cluster has less than 3 ZOOKEPER_SERVER components', function () {
       hostComponents = [
       hostComponents = [
@@ -101,10 +87,6 @@ describe('App.MainAdminHighAvailabilityController', function () {
       App.router.get.restore();
       App.router.get.restore();
     });
     });
     it('total hosts number less than 3', function () {
     it('total hosts number less than 3', function () {
-      sinon.stub(controller, 'get', function (k) {
-        if (k === 'securityEnabled') return false;
-        return Em.get(controller, k);
-      });
       hostComponents = [
       hostComponents = [
         Em.Object.create({
         Em.Object.create({
           componentName: 'NAMENODE',
           componentName: 'NAMENODE',
@@ -129,13 +111,8 @@ describe('App.MainAdminHighAvailabilityController', function () {
       expect(controller.enableHighAvailability()).to.be.false;
       expect(controller.enableHighAvailability()).to.be.false;
       expect(controller.showErrorPopup.calledOnce).to.be.true;
       expect(controller.showErrorPopup.calledOnce).to.be.true;
       App.router.get.restore();
       App.router.get.restore();
-      controller.get.restore();
     });
     });
     it('All checks passed', function () {
     it('All checks passed', function () {
-      sinon.stub(controller, 'get', function (k) {
-        if (k === 'securityEnabled') return false;
-        return Em.get(controller, k);
-      });
       hostComponents = [
       hostComponents = [
         Em.Object.create({
         Em.Object.create({
           componentName: 'NAMENODE',
           componentName: 'NAMENODE',
@@ -161,7 +138,6 @@ describe('App.MainAdminHighAvailabilityController', function () {
       expect(App.router.transitionTo.calledWith('main.services.enableHighAvailability')).to.be.true;
       expect(App.router.transitionTo.calledWith('main.services.enableHighAvailability')).to.be.true;
       expect(controller.showErrorPopup.calledOnce).to.be.false;
       expect(controller.showErrorPopup.calledOnce).to.be.false;
       App.router.get.restore();
       App.router.get.restore();
-      controller.get.restore();
     });
     });
   });
   });