You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/04/13 23:43:16 UTC
ambari git commit: AMBARI-10356. Ambari Upgrade from 1.6.1 to 1.7.0
fails when analyzing global config groups with certain data (alejandro)
Repository: ambari
Updated Branches:
refs/heads/trunk dbc2eef82 -> e5e72d80d
AMBARI-10356. Ambari Upgrade from 1.6.1 to 1.7.0 fails when analyzing global config groups with certain data (alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e5e72d80
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e5e72d80
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e5e72d80
Branch: refs/heads/trunk
Commit: e5e72d80d898569d0583e227e9a694f09a559f67
Parents: dbc2eef
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Thu Apr 9 20:25:35 2015 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Mon Apr 13 14:43:08 2015 -0700
----------------------------------------------------------------------
.../ambari/server/upgrade/UpgradeCatalog170.java | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e72d80/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index db0506b..2259c92 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -835,15 +835,17 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
Set<String> configTypes = configHelper.findConfigTypesByPropertyName(cluster.getCurrentStackVersion(),
property.getKey(), cluster.getClusterName());
// i'm not sure, but i hope that every service property is unique
- String configType = configTypes.iterator().next();
+ if (configTypes != null && configTypes.size() > 0) {
+ String configType = configTypes.iterator().next();
- if (configs.containsKey(configType)) {
- HashMap<String, String> config = configs.get(configType);
- config.put(property.getKey(), property.getValue());
- } else {
- HashMap<String, String> config = new HashMap<String, String>();
- config.put(property.getKey(), property.getValue());
- configs.put(configType, config);
+ if (configs.containsKey(configType)) {
+ HashMap<String, String> config = configs.get(configType);
+ config.put(property.getKey(), property.getValue());
+ } else {
+ HashMap<String, String> config = new HashMap<String, String>();
+ config.put(property.getKey(), property.getValue());
+ configs.put(configType, config);
+ }
}
}