ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rz...@apache.org
Subject ambari git commit: AMBARI-21205 Make ToggleKerberos and AddDeleteService experimental features (Duc Le via rzang)
Date Sun, 11 Jun 2017 21:45:02 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 8ff4d12d3 -> a7d452567


AMBARI-21205 Make ToggleKerberos and AddDeleteService experimental features (Duc Le via rzang)

Change-Id: I578ddcebbad34eefd40abef4b6524fc69b4cb8fc


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

Branch: refs/heads/branch-2.4
Commit: a7d4525674dfa751243cecdf0c318e6b5aff33b1
Parents: 8ff4d12
Author: Richard Zang <rzang@apache.org>
Authored: Thu Jun 8 15:38:38 2017 -0700
Committer: Richard Zang <rzang@apache.org>
Committed: Sun Jun 11 14:44:35 2017 -0700

----------------------------------------------------------------------
 ambari-web/app/config.js                        |  6 +++-
 ambari-web/app/routes/add_service_routes.js     |  2 +-
 ambari-web/app/routes/main.js                   |  2 +-
 .../app/templates/main/admin/kerberos.hbs       | 38 +++++++++++---------
 .../main/service/all_services_actions.hbs       | 14 ++++----
 ambari-web/app/views/main/admin.js              | 14 ++++----
 .../main/admin/stack_upgrade/services_view.js   |  2 +-
 ambari-web/app/views/main/menu.js               | 14 ++++----
 ambari-web/app/views/main/service/item.js       |  2 +-
 .../admin/stack_upgrade/services_view_test.js   |  1 +
 10 files changed, 55 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index ce6516e..5e7671b 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -84,7 +84,11 @@ App.supports = {
   enableIpa: false,
   addingNewRepository: false,
   kerberosStackAdvisor: true,
-  logCountVizualization: false
+  logCountVizualization: false,
+  enabledWizardForHostOrderedUpgrade: true,
+  manageJournalNode: true,
+  enableToggleKerberos: true,
+  enableAddDeleteServices: true
 };
 
 if (App.enableExperimental) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/app/routes/add_service_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js
index 88e196a..f751ea1 100644
--- a/ambari-web/app/routes/add_service_routes.js
+++ b/ambari-web/app/routes/add_service_routes.js
@@ -24,7 +24,7 @@ module.exports = App.WizardRoute.extend({
   route: '/service/add',
 
   enter: function (router) {
-    if (App.isAuthorized('SERVICE.ADD_DELETE_SERVICES')) {
+    if (App.isAuthorized('SERVICE.ADD_DELETE_SERVICES') && App.supports.enableAddDeleteServices)
{
       // `getSecurityStatus` call is required to retrieve information related to kerberos
type: Manual or automated kerberos
       router.get('mainController').isLoading.call(router.get('clusterController'),'isClusterNameLoaded').done(function
() {
         App.router.get('mainAdminKerberosController').getSecurityStatus().always(function
() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 45c1cd3..95e8176 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -396,7 +396,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
     adminKerberos: Em.Route.extend({
       route: '/kerberos',
       enter: function (router, transition) {
-        if (router.get('loggedIn') && !App.isAuthorized('CLUSTER.TOGGLE_KERBEROS'))
{
+        if (router.get('loggedIn') && (!App.isAuthorized('CLUSTER.TOGGLE_KERBEROS')
|| !App.supports.enableToggleKerberos)) {
           router.transitionTo('main.dashboard.index');
         }
       },

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/app/templates/main/admin/kerberos.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/kerberos.hbs b/ambari-web/app/templates/main/admin/kerberos.hbs
index 1e3be1a..dda9886 100644
--- a/ambari-web/app/templates/main/admin/kerberos.hbs
+++ b/ambari-web/app/templates/main/admin/kerberos.hbs
@@ -20,21 +20,23 @@
     <div>
       <p class="text-success">{{t admin.security.enabled}}
         {{#isAuthorized "CLUSTER.TOGGLE_KERBEROS"}}
-          <button class="btn btn-padding btn-warning admin-disable-security-btn" {{bindAttr
disabled="isKerberosButtonsDisabled"}} {{action notifySecurityOffPopup target="controller"}}>{{t
admin.kerberos.button.disable}} </button>
-          {{#unless isManualKerberos}}
-            <button class="btn btn-success" id="regenerate-keytabs" {{bindAttr disabled="isKerberosButtonsDisabled"}}
{{action regenerateKeytabs target="controller"}}>
-              <i class="icon-repeat"></i> {{t admin.kerberos.button.regenerateKeytabs}}</button>
-            {{#if App.isCredentialStorePersistent}}
-              <button class="btn btn-primary" {{action showManageKDCCredentialsPopup target="controller"}}>{{t
admin.kerberos.credentials.store.menu.label}}</button>
-            {{/if}}
-          {{/unless}}
-          <br/>
-          {{#unless isEditMode}}
-            <a {{action makeConfigsEditable target="controller"}}
-                    class="pull-right edit-link">
-              {{t common.edit}}
-            </a>
-          {{/unless}}
+          {{#if App.supports.enableToggleKerberos}}
+            <button class="btn btn-padding btn-warning admin-disable-security-btn" {{bindAttr
disabled="isKerberosButtonsDisabled"}} {{action notifySecurityOffPopup target="controller"}}>{{t
admin.kerberos.button.disable}} </button>
+            {{#unless isManualKerberos}}
+              <button class="btn btn-success" id="regenerate-keytabs" {{bindAttr disabled="isKerberosButtonsDisabled"}}
{{action regenerateKeytabs target="controller"}}>
+                <i class="icon-repeat"></i> {{t admin.kerberos.button.regenerateKeytabs}}</button>
+              {{#if App.isCredentialStorePersistent}}
+                <button class="btn btn-primary" {{action showManageKDCCredentialsPopup
target="controller"}}>{{t admin.kerberos.credentials.store.menu.label}}</button>
+              {{/if}}
+            {{/unless}}
+            <br/>
+            {{#unless isEditMode}}
+              <a {{action makeConfigsEditable target="controller"}}
+                      class="pull-right edit-link">
+                {{t common.edit}}
+              </a>
+            {{/unless}}
+          {{/if}}
         {{/isAuthorized}}
       </p>
     </div>
@@ -54,8 +56,10 @@
     <div>
       <p class="muted background-text">{{t admin.security.disabled}}
       {{#isAuthorized "CLUSTER.TOGGLE_KERBEROS"}}
-        <a class="btn btn-padding btn-success admin-enable-security-btn" {{action checkAndStartKerberosWizard
target="controller"}}>{{t admin.kerberos.button.enable}} </a>
-        <br/>
+        {{#if App.supports.enableToggleKerberos}}
+          <a class="btn btn-padding btn-success admin-enable-security-btn" {{action checkAndStartKerberosWizard
target="controller"}}>{{t admin.kerberos.button.enable}} </a>
+          <br/>
+        {{/if}}
       {{/isAuthorized}}
       </p>
     </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/app/templates/main/service/all_services_actions.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/all_services_actions.hbs b/ambari-web/app/templates/main/service/all_services_actions.hbs
index edcd29c..057f9b2 100644
--- a/ambari-web/app/templates/main/service/all_services_actions.hbs
+++ b/ambari-web/app/templates/main/service/all_services_actions.hbs
@@ -24,12 +24,14 @@
             </a>
             <ul class="pull-left dropdown-menu">
                 {{#isAuthorized "SERVICE.ADD_DELETE_SERVICES"}}
-                    <li {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled"}}>
-                        <a href="#"
-                            {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled"}}
-                            {{action gotoAddService target="view.serviceController"}}>
-                            <i class="icon-plus icon-white"></i> {{t services.service.add}}</a>
-                    </li>
+                    {{#if App.supports.enableAddDeleteServices}}
+                        <li {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled"}}>
+                            <a href="#"
+                                {{bindAttr class="view.serviceController.isAllServicesInstalled:disabled"}}
+                                {{action gotoAddService target="view.serviceController"}}>
+                                <i class="icon-plus icon-white"></i> {{t services.service.add}}</a>
+                        </li>
+                    {{/if}}
                 {{/isAuthorized}}
                 {{#isAuthorized "SERVICE.START_STOP"}}
                     <li class="divider"></li>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/app/views/main/admin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin.js b/ambari-web/app/views/main/admin.js
index 704527b..3e10e4a 100644
--- a/ambari-web/app/views/main/admin.js
+++ b/ambari-web/app/views/main/admin.js
@@ -39,12 +39,14 @@ App.MainAdminView = Em.View.extend({
       });
     }
     if (!App.get('isHadoopWindowsStack') && App.isAuthorized('CLUSTER.TOGGLE_KERBEROS')
|| (App.get('upgradeInProgress') || App.get('upgradeHolding')) ) {
-      items.push({
-        name: 'kerberos',
-        url: 'adminKerberos.index',
-        label: Em.I18n.t('common.kerberos'),
-        disabled: App.get('upgradeInProgress') || App.get('upgradeHolding')
-      });
+      if (App.supports.enableToggleKerberos) {
+        items.push({
+          name: 'kerberos',
+          url: 'adminKerberos.index',
+          label: Em.I18n.t('common.kerberos'),
+          disabled: App.get('upgradeInProgress') || App.get('upgradeHolding')
+        });
+      }
     }
     if (App.isAuthorized('SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS') || (App.get('upgradeInProgress')
|| App.get('upgradeHolding'))) {
       if (App.supports.serviceAutoStart) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/app/views/main/admin/stack_upgrade/services_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/services_view.js b/ambari-web/app/views/main/admin/stack_upgrade/services_view.js
index f566814..25efffe 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/services_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/services_view.js
@@ -56,7 +56,7 @@ App.MainAdminStackServicesView = Em.View.extend({
    * @param event
    */
   goToAddService: function (event) {
-    if (!App.isAuthorized('SERVICE.ADD_DELETE_SERVICES')) {
+    if (!App.isAuthorized('SERVICE.ADD_DELETE_SERVICES') || !App.supports.enableAddDeleteServices)
{
       return;
     } else if (event.context == "KERBEROS") {
       App.router.get('mainAdminKerberosController').checkAndStartKerberosWizard();

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/app/views/main/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js
index f60ae8a..11e6525 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/ambari-web/app/views/main/menu.js
@@ -121,12 +121,14 @@ App.MainMenuView = Em.CollectionView.extend({
           });
         }
         if (!App.get('isHadoopWindowsStack') && App.isAuthorized('CLUSTER.TOGGLE_KERBEROS')
|| (App.get('upgradeInProgress') || App.get('upgradeHolding'))) {
-          categories.push({
-            name: 'kerberos',
-            url: 'kerberos/',
-            label: Em.I18n.t('common.kerberos'),
-            disabled: App.get('upgradeInProgress') || App.get('upgradeHolding')
-          });
+          if (App.supports.enableToggleKerberos) {
+            categories.push({
+              name: 'kerberos',
+              url: 'kerberos/',
+              label: Em.I18n.t('common.kerberos'),
+              disabled: App.get('upgradeInProgress') || App.get('upgradeHolding')
+            });
+          }
         }
         if (App.isAuthorized('SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS') || (App.get('upgradeInProgress')
|| App.get('upgradeHolding'))) {
           if (App.supports.serviceAutoStart) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index a007e17..7b1156f 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -280,7 +280,7 @@ App.MainServiceItemView = Em.View.extend({
       options.push(actionMap.DOWNLOAD_CLIENT_CONFIGS);
     }
 
-    if (App.isAuthorized("SERVICE.ADD_DELETE_SERVICES")) {
+    if (App.isAuthorized("SERVICE.ADD_DELETE_SERVICES") && App.supports.enableAddDeleteServices)
{
       options.push(actionMap.DELETE_SERVICE);
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7d45256/ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js
index 70d182c..da75cf2 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/services_view_test.js
@@ -34,6 +34,7 @@ describe('App.MainAdminStackServicesView', function () {
       sinon.stub(App.router, 'get').returns(mock);
       sinon.spy(mock, 'checkAndStartKerberosWizard');
       isAccessibleMock = sinon.stub(App, 'isAuthorized');
+      App.set('supports.enableAddDeleteServices', true);
     });
     afterEach(function() {
       App.get('router').transitionTo.restore();


Mime
View raw message