private void trimProperties(Configuration clusterConfig, ClusterTopology clusterTopology) {
    Blueprint blueprint = clusterTopology.getBlueprint();
    Stack stack = blueprint.getStack();

    Map<String, Map<String, String>> configTypes = clusterConfig.getFullProperties();
    for (String configType : configTypes.keySet()) {
      Map<String,String> properties = configTypes.get(configType);
      for (String propertyName : properties.keySet()) {
        trimPropertyValue(clusterConfig, stack, configType, properties, propertyName);
      }
    }
  }
Encapsulates commonly repeated tasks around updating a configuration value during cluster creation.
@param configType the configuration type (e.g. hdfs-site)
@param propertyName the name of the property (e.g. dfs.namenode.name.dir)
@param oldValue the old value of the property
@param updater the property updater to use
@param allProps other properties to be considered by the updater
@param configuration configuration to update (cluster global config or hostgroup config)
@param configTypesUpdated set of updated config types (configType param will be added if updater changes the
                          value of the property)
@param alwaysUpdateConfig boolean to indicate whether the {@link Configuration} received as parameter should always
                          (except when new value is {@code null}) be updated or only in case the new value differs
                          from the original. (TODO: what is the reason for always updating the configuration?)
@return the updated value
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java