You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2013/04/08 22:30:54 UTC

svn commit: r1465766 - in /incubator/ambari/trunk: CHANGES.txt ambari-web/app/controllers/main/service/info/configs.js ambari-web/app/utils/config.js

Author: jaimin
Date: Mon Apr  8 20:30:54 2013
New Revision: 1465766

URL: http://svn.apache.org/r1465766
Log:
AMBARI-1837. Few core-site properties vanished after seemingly benign reconfiguration. (jaimin)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
    incubator/ambari/trunk/ambari-web/app/utils/config.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1465766&r1=1465765&r2=1465766&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Mon Apr  8 20:30:54 2013
@@ -656,6 +656,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1837. Few core-site properties vanished after seemingly benign 
+reconfiguration. (jaimin)
+
  AMBARI-1838. Cluster Management > Services > MapReduce > Config throws JS error
  and the page comes up blank. (jaimin)
 

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js?rev=1465766&r1=1465765&r2=1465766&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js Mon Apr  8 20:30:54 2013
@@ -806,9 +806,8 @@ App.MainServiceInfoConfigsController = E
       if(typeof _config.get('value') === "boolean") _config.set('value', _config.value.toString());
     });
     var storedConfigs = serviceConfigProperties.filterProperty('value');
-    var preConfigs = this.loadUiSideConfigs(this.get('configMapping').overridable());
-    var postConfigs = this.loadUiSideConfigs(this.get('configMapping').computed());
-    this.set('uiConfigs', preConfigs.concat(storedConfigs).concat(postConfigs));
+    var allUiConfigs = this.loadUiSideConfigs(this.get('configMapping').all());
+    this.set('uiConfigs', storedConfigs.concat(allUiConfigs));
   },
 
   /**
@@ -830,16 +829,6 @@ App.MainServiceInfoConfigsController = E
         });
       }
     }, this);
-    var dependentConfig = configMapping.filterProperty('foreignKey');
-    dependentConfig.forEach(function (_config) {
-      this.setConfigValue(uiConfig, _config);
-      uiConfig.pushObject({
-        "id": "site property",
-        "name": _config._name || _config.name,
-        "value": _config.value,
-        "filename": _config.filename
-      });
-    }, this);
     return uiConfig;
   },
 
@@ -896,62 +885,6 @@ App.MainServiceInfoConfigsController = E
     }, this);
     return value;
   },
-  /**
-   * Set all site property that are derived from other site-properties
-   */
-  setConfigValue: function (uiConfig, config) {
-    if (config.value == null) {
-      return;
-    }
-    var fkValue = config.value.match(/<(foreignKey.*?)>/g);
-    if (fkValue) {
-      fkValue.forEach(function (_fkValue) {
-        var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
-        if (uiConfig.someProperty('name', config.foreignKey[index])) {
-          var globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
-          config.value = config.value.replace(_fkValue, globalValue);
-        } else if (this.get('globalConfigs').someProperty('name', config.foreignKey[index])) {
-          var globalValue;
-          if (this.get('globalConfigs').findProperty('name', config.foreignKey[index]).value === '') {
-            globalValue = this.get('globalConfigs').findProperty('name', config.foreignKey[index]).defaultValue;
-          } else {
-            globalValue = this.get('globalConfigs').findProperty('name', config.foreignKey[index]).value;
-          }
-          config.value = config.value.replace(_fkValue, globalValue);
-        }
-      }, this);
-    }
-    if (fkValue = config.name.match(/<(foreignKey.*?)>/g)) {
-      fkValue.forEach(function (_fkValue) {
-        var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
-        if (uiConfig.someProperty('name', config.foreignKey[index])) {
-          var globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
-          config._name = config.name.replace(_fkValue, globalValue);
-        } else if (this.get('globalConfigs').someProperty('name', config.foreignKey[index])) {
-          var globalValue;
-          if (this.get('globalConfigs').findProperty('name', config.foreignKey[index]).value === '') {
-            globalValue = this.get('globalConfigs').findProperty('name', config.foreignKey[index]).defaultValue;
-          } else {
-            globalValue = this.get('globalConfigs').findProperty('name', config.foreignKey[index]).value;
-          }
-          config._name = config.name.replace(_fkValue, globalValue);
-        }
-      }, this);
-    }
-    //For properties in the configMapping file having foreignKey and templateName properties.
-    var templateValue = config.value.match(/<(templateName.*?)>/g);
-    if (templateValue) {
-      templateValue.forEach(function (_value) {
-        var index = parseInt(_value.match(/\[([\d]*)(?=\])/)[1]);
-        if (this.get('globalConfigs').someProperty('name', config.templateName[index])) {
-          var globalValue = this.get('globalConfigs').findProperty('name', config.templateName[index]).value;
-          config.value = config.value.replace(_value, globalValue);
-        } else {
-          config.value = null;
-        }
-      }, this);
-    }
-  },
 
   /**
    * Saves cluster level configurations for all necessary sites.

Modified: incubator/ambari/trunk/ambari-web/app/utils/config.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/utils/config.js?rev=1465766&r1=1465765&r2=1465766&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/utils/config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/utils/config.js Mon Apr  8 20:30:54 2013
@@ -88,7 +88,7 @@ App.config = Em.Object.create({
           defaultValue: properties[index],
           filename: _tag.siteName + ".xml",
           isUserProperty: false,
-          isOverrideable: true
+          isOverridable: true
         };
 
         if (configsPropertyDef) {
@@ -98,7 +98,7 @@ App.config = Em.Object.create({
           serviceConfigObj.isVisible = (configsPropertyDef.isVisible !== undefined) ? configsPropertyDef.isVisible : true;
           serviceConfigObj.unit = (configsPropertyDef.unit !== undefined) ? configsPropertyDef.unit : undefined;
           serviceConfigObj.description = (configsPropertyDef.description !== undefined) ? configsPropertyDef.description : undefined;
-          serviceConfigObj.isOverrideable = configsPropertyDef.isOverridable === undefined ? true : configsPropertyDef.isOverridable;
+          serviceConfigObj.isOverridable = configsPropertyDef.isOverridable === undefined ? true : configsPropertyDef.isOverridable;
         }
         if (_tag.siteName === 'global') {
           if (configsPropertyDef) {