ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: Revert "AMBARI-12141. Kerberos configs aren't restored when moving back from Review to the Configure Identities step (rzang)"
Date Thu, 30 Jul 2015 14:16:42 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b46db5d55 -> 9552b8649


Revert "AMBARI-12141. Kerberos configs aren't restored when moving back from Review to the
Configure Identities step (rzang)"


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

Branch: refs/heads/trunk
Commit: 9552b8649804981adc99a4223210d79c34175b48
Parents: b46db5d
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Thu Jul 30 17:15:41 2015 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Thu Jul 30 17:15:41 2015 +0300

----------------------------------------------------------------------
 .../main/admin/kerberos/step2_controller.js        |  2 +-
 .../main/admin/kerberos/step4_controller.js        | 14 ++------------
 ambari-web/app/routes/add_kerberos_routes.js       |  2 --
 ambari-web/app/routes/add_service_routes.js        |  2 --
 ambari-web/app/utils/config.js                     | 17 -----------------
 .../main/admin/kerberos/step4_controller_test.js   |  6 ------
 6 files changed, 3 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9552b864/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
index 080807e..8972949 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
@@ -81,7 +81,7 @@ App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend({
    * @method loadStep
    */
   loadStep: function () {
-    console.log("TRACE: Loading step2: Configure Kerberos");
+    console.log("TRACE: Loading step7: Configure Services");
     if (!App.StackService.find().someProperty('serviceName', 'KERBEROS') || !this.get('isConfigsLoaded'))
{
       return;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/9552b864/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
index 500f2c7..08f4e10 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -21,9 +21,6 @@ require('controllers/wizard/step7_controller');
 
 App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecurityConfigs,
App.ToggleIsRequiredMixin, {
   name: 'kerberosWizardStep4Controller',
-  isWithinAddService: function () {
-    return this.get('wizardController.name') == 'addServiceController';
-  }.property('wizardController.name'),
 
   adminPropertyNames: [{name: 'admin_principal', displayName: 'Admin principal'}, {name:
'admin_password', displayName: 'Admin password'}],
   
@@ -169,20 +166,13 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
    * @returns {App.ServiceConfigProperty[]}
    */
   prepareConfigProperties: function(configs) {
-    console.log("call prepare");
     var self = this;
     var storedServiceConfigs = this.get('wizardController').getDBProperty('serviceConfigProperties');
     var installedServiceNames = ['Cluster'].concat(App.Service.find().mapProperty('serviceName'));
     var adminProps = [];
     var configProperties = configs.slice(0);
     var siteProperties = App.config.get('preDefinedSiteProperties');
-    // override stored values
-    App.config.mergeStoredValue(configProperties, storedServiceConfigs);
-    console.log(this.get('wizardController'));
-    App.config.mergeStoredValue(configProperties, this.get('wizardController').loadCachedStepConfigValues(this));
-
-    // show admin properties in add service wizard
-    if (this.get('isWithinAddService')) {
+    if (this.get('wizardController.name') == 'addServiceController') {
       installedServiceNames = installedServiceNames.concat(this.get('selectedServiceNames'));
       this.get('adminPropertyNames').forEach(function(item) {
         var property = storedServiceConfigs.filterProperty('filename', 'krb5-conf.xml').findProperty('name',
item.name);
@@ -198,8 +188,8 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
           adminProps.push(_prop);
         }
       });
+      configProperties = adminProps.concat(configProperties);
     }
-    configProperties = adminProps.concat(configProperties);
     configProperties = configProperties.filter(function(item) {
       return installedServiceNames.contains(item.get('serviceName'));
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/9552b864/ambari-web/app/routes/add_kerberos_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_kerberos_routes.js b/ambari-web/app/routes/add_kerberos_routes.js
index 716d738..e3a40f8 100644
--- a/ambari-web/app/routes/add_kerberos_routes.js
+++ b/ambari-web/app/routes/add_kerberos_routes.js
@@ -210,7 +210,6 @@ module.exports = App.WizardRoute.extend({
     next: function (router) {
       var kerberosWizardController = router.get('kerberosWizardController');
       kerberosWizardController.setDBProperty('kerberosDescriptorConfigs', null);
-      kerberosWizardController.clearCachedStepConfigValues(router.get('kerberosWizardStep4Controller'));
       router.transitionTo('step4');
     }
   }),
@@ -245,7 +244,6 @@ module.exports = App.WizardRoute.extend({
       var kerberosWizardController = router.get('kerberosWizardController');
       var step5Controller = router.get('kerberosWizardStep5Controller');
       var kerberosDescriptor = kerberosWizardController.get('kerberosDescriptorConfigs');
-      kerberosWizardController.cacheStepConfigValues(router.get('kerberosWizardStep4Controller'));
       step5Controller.postKerberosDescriptor(kerberosDescriptor).always(function (data, result,
request) {
         if (result === 'error' && data.status === 409) {
           step5Controller.putKerberosDescriptor(kerberosDescriptor);

http://git-wip-us.apache.org/repos/asf/ambari/blob/9552b864/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 96937f9..262049e 100644
--- a/ambari-web/app/routes/add_service_routes.js
+++ b/ambari-web/app/routes/add_service_routes.js
@@ -242,7 +242,6 @@ module.exports = App.WizardRoute.extend({
       addServiceController.saveServiceConfigProperties(wizardStep7Controller);
       addServiceController.saveServiceConfigGroups(wizardStep7Controller, true);
       if (App.get('isKerberosEnabled')) {
-        addServiceController.clearCachedStepConfigValues(router.get('kerberosWizardStep4Controller'));
         router.transitionTo('step5');
         return;
       }
@@ -289,7 +288,6 @@ module.exports = App.WizardRoute.extend({
         } else {
           router.get('kerberosWizardStep2Controller').createKerberosAdminSession(router.get('kerberosWizardStep4Controller.stepConfigs')[0].get('configs'));
         }
-        router.get('addServiceController').cacheStepConfigValues(router.get('kerberosWizardStep4Controller'));
       }
       router.transitionTo('step6');
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/9552b864/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 2ecabc5..fd6e5c8 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -1414,23 +1414,6 @@ App.config = Em.Object.create({
     return newOverride;
   },
 
-
-  /**
-   * Merge values in "stored" to "base" if name matches, it's a value only merge.
-   * @param base {Array} Em.Object
-   * @param stored {Array} Object
-   */
-  mergeStoredValue: function(base, stored) {
-    if (stored) {
-      base.forEach(function (p) {
-        var sp = stored.findProperty("name", p.name);
-        if (sp) {
-          p.set("value", sp.value);
-        }
-      });
-    }
-  },
-
   /**
    * Update config property value based on its current value and list of zookeeper server
hosts.
    * Used to prevent sort order issues.

http://git-wip-us.apache.org/repos/asf/ambari/blob/9552b864/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
index e4abd82..af0650c 100644
--- a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
@@ -58,9 +58,6 @@ describe('App.KerberosWizardStep4Controller', function() {
             return Em.A([
               Em.Object.create({ name: 'realm', value: 'realm_value' })
             ]);
-          },
-          loadCachedStepConfigValues: function() {
-            return null;
           }
         }
       });
@@ -188,9 +185,6 @@ describe('App.KerberosWizardStep4Controller', function() {
                 Em.Object.create({ name: 'admin_principal', value: 'some_val1', recommendedValue:
'some_val1', filename: 'krb5-conf.xml' }),
                 Em.Object.create({ name: 'admin_password', value: 'some_password', recommendedValue:
'some_password', filename: 'krb5-conf.xml' })
               ]);
-            },
-            loadCachedStepConfigValues : function() {
-              return null;
             }
           })
         });


Mime
View raw message