Repository: ambari Updated Branches: refs/heads/branch-2.5 8b440e7f6 -> 3ca58f29b
AMBARI-20551. Blueprint export fails if config-type is not mapped to any service after upgrade (Amruta Borkar via alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3ca58f29 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3ca58f29 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3ca58f29 Branch: refs/heads/branch-2.5 Commit: 3ca58f29baf94bf96ac7e5bc1ad343fdf2d7b700 Parents: 8b440e7 Author: Alejandro Fernandez <[email protected]> Authored: Thu Apr 6 16:32:58 2017 -0700 Committer: Sandor Magyari <[email protected]> Committed: Tue Apr 11 16:13:49 2017 +0200 ---------------------------------------------------------------------- .../internal/BlueprintConfigurationProcessor.java | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3ca58f29/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java index ae927c7..e77d718 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java @@ -521,6 +521,15 @@ public class BlueprintConfigurationProcessor { Map<String, Map<String, String>> properties = configuration.getFullProperties(); for (Map.Entry<String, Map<String, String>> configEntry : properties.entrySet()) { String type = configEntry.getKey(); + try { + clusterTopology.getBlueprint().getStack().getServiceForConfigType(type); + } catch (IllegalArgumentException illegalArgumentException) { + LOG.error(new StringBuilder(String.format("Error encountered while trying to obtain the service name for config type [%s]. ", type)) + .append("Further processing on this config type will be skipped. ") + .append("This usually means that a service's definitions have been manually removed from the Ambari stack definitions. ") + .append("If the stack definitions have not been changed manually, this may indicate a stack definition error in Ambari. ").toString(), illegalArgumentException); + continue; + } Map<String, String> typeProperties = configEntry.getValue(); for (Map.Entry<String, String> propertyEntry : typeProperties.entrySet()) {
