ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [04/22] ambari git commit: AMBARI-20551. Blueprint export fails if config-type is not mapped to any service after upgrade (Amruta Borkar via alejandro)
Date Tue, 11 Apr 2017 11:14:26 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/6dba326c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6dba326c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6dba326c

Branch: refs/heads/branch-3.0-perf
Commit: 6dba326c1202cc7e3ac6175b53591474c12f88e9
Parents: 784ceea
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Thu Apr 6 16:32:58 2017 -0700
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue Apr 11 14:14:12 2017 +0300

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/6dba326c/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