You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2016/12/22 17:08:08 UTC

[04/26] ambari git commit: AMBARI-19225 Ambari server should prints error messages to its log if it can't find property for given property attribute type (dili)

AMBARI-19225 Ambari server should prints error messages to its log if it can't find property for given property attribute type (dili)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c01f4d80
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c01f4d80
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c01f4d80

Branch: refs/heads/branch-dev-patch-upgrade
Commit: c01f4d809dfd4134fa789fd0496d73877117ba14
Parents: 64f3b39
Author: Di Li <di...@apache.org>
Authored: Tue Dec 20 12:01:13 2016 -0500
Committer: Di Li <di...@apache.org>
Committed: Tue Dec 20 12:01:13 2016 -0500

----------------------------------------------------------------------
 .../org/apache/ambari/server/state/ConfigHelper.java   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c01f4d80/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index 54752f9..7e75469 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -551,7 +551,18 @@ public class ConfigHelper {
         if (serviceProperty.getPropertyTypes().contains(propertyType)) {
           String stackPropertyConfigType = fileNameToConfigType(serviceProperty.getFilename());
           try {
-            result.add(actualConfigs.get(stackPropertyConfigType).getProperties().get(serviceProperty.getName()));
+            String property = actualConfigs.get(stackPropertyConfigType).getProperties().get(serviceProperty.getName());
+            if (null == property){
+              LOG.error(String.format("Unable to obtain property values for %s with property attribute %s. "
+                  + "The property does not exist in version %s of %s configuration.",
+                  serviceProperty.getName(),
+                  propertyType,
+                  desiredConfigs.get(stackPropertyConfigType),
+                  stackPropertyConfigType
+                  ));
+            } else {
+              result.add(property);
+            }
           } catch (Exception ignored) {
           }
         }