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 2017/04/11 18:29:17 UTC

[29/50] [abbrv] ambari git commit: AMBARI-20551. Blueprint export fails if config-type is not mapped to any service after upgrade (Amruta Borkar via alejandro)

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/bb614a0f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bb614a0f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bb614a0f

Branch: refs/heads/ambari-rest-api-explorer
Commit: bb614a0ff7cf933e513fec5a6ed7b55c5c89cb9f
Parents: 301896a
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Thu Apr 6 16:32:58 2017 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Thu Apr 6 16:33:01 2017 -0700

----------------------------------------------------------------------
 .../internal/BlueprintConfigurationProcessor.java           | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bb614a0f/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 db1aa07..88a8f80 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
@@ -517,6 +517,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()) {