ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject [2/2] ambari git commit: AMBARI-9065 Remove the code to disallow the user from proceeding with HA Wizard if Kerberos is already enabled. (ababiichuk)
Date Fri, 09 Jan 2015 16:07:55 GMT
AMBARI-9065 Remove the code to disallow the user from proceeding with HA Wizard if Kerberos
is already enabled. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c87fa43b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c87fa43b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c87fa43b

Branch: refs/heads/trunk
Commit: c87fa43bec2d92089598a3acd6a4cc3ead78a8dc
Parents: 7efa121
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Fri Jan 9 17:38:48 2015 +0200
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Fri Jan 9 18:07:50 2015 +0200

----------------------------------------------------------------------
 .../main/admin/highAvailability_controller.js   | 35 ++++++++------------
 ambari-web/app/messages.js                      |  1 -
 .../admin/highAvailability_controller_test.js   | 24 --------------
 3 files changed, 13 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c87fa43b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
index 8d79f96..bac7b67 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
@@ -21,10 +21,6 @@ var App = require('app');
 App.MainAdminHighAvailabilityController = Em.Controller.extend({
   name: 'mainAdminHighAvailabilityController',
 
-  securityEnabled: function () {
-    return App.router.get('mainAdminSecurityController.securityEnabled');
-  }.property('App.router.mainAdminSecurityController.securityEnabled'),
-
   tag: null,
 
   dataIsLoaded: false,
@@ -36,25 +32,20 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({
   enableHighAvailability: function () {
     var message = [];
     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');
     return true;

http://git-wip-us.apache.org/repos/asf/ambari/blob/c87fa43b/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 2f39823..d84cf5e 100644
--- a/ambari-web/app/messages.js
+++ b/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.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.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.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?',

http://git-wip-us.apache.org/repos/asf/ambari/blob/c87fa43b/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js
index 1cdb75d..0a75d9f 100644
--- a/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/highAvailability_controller_test.js
@@ -44,20 +44,7 @@ describe('App.MainAdminHighAvailabilityController', function () {
       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 () {
-      sinon.stub(controller, 'get', function (k) {
-        if (k === 'securityEnabled') return false;
-        return Em.get(controller, k);
-      });
       hostComponents = [
         Em.Object.create({
           componentName: 'NAMENODE',
@@ -83,7 +70,6 @@ describe('App.MainAdminHighAvailabilityController', function () {
       expect(controller.enableHighAvailability()).to.be.false;
       expect(controller.showErrorPopup.calledOnce).to.be.true;
       App.router.get.restore();
-      controller.get.restore();
     });
     it('Cluster has less than 3 ZOOKEPER_SERVER components', function () {
       hostComponents = [
@@ -101,10 +87,6 @@ describe('App.MainAdminHighAvailabilityController', function () {
       App.router.get.restore();
     });
     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 = [
         Em.Object.create({
           componentName: 'NAMENODE',
@@ -129,13 +111,8 @@ describe('App.MainAdminHighAvailabilityController', function () {
       expect(controller.enableHighAvailability()).to.be.false;
       expect(controller.showErrorPopup.calledOnce).to.be.true;
       App.router.get.restore();
-      controller.get.restore();
     });
     it('All checks passed', function () {
-      sinon.stub(controller, 'get', function (k) {
-        if (k === 'securityEnabled') return false;
-        return Em.get(controller, k);
-      });
       hostComponents = [
         Em.Object.create({
           componentName: 'NAMENODE',
@@ -161,7 +138,6 @@ describe('App.MainAdminHighAvailabilityController', function () {
       expect(App.router.transitionTo.calledWith('main.services.enableHighAvailability')).to.be.true;
       expect(controller.showErrorPopup.calledOnce).to.be.false;
       App.router.get.restore();
-      controller.get.restore();
     });
   });
 


Mime
View raw message