ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [02/35] ambari git commit: AMBARI-20551. Blueprint export fails if config-type is not mapped to any service after upgrade (Amruta Borkar via alejandro)
Date Wed, 12 Apr 2017 13:48:47 GMT
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/branch-feature-AMBARI-12556
Commit: bb614a0ff7cf933e513fec5a6ed7b55c5c89cb9f
Parents: 301896a
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Thu Apr 6 16:32:58 2017 -0700
Committer: Alejandro Fernandez <afernandez@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()) {


Mime
View raw message