You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2018/03/14 14:36:47 UTC

[ambari] branch trunk updated: AMBARI-23224. Dependency check should ignore unknown services (#647)

This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 988ec0a  AMBARI-23224. Dependency check should ignore unknown services (#647)
988ec0a is described below

commit 988ec0a50345dddccb713c6adeeb4e20cadbceaf
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Wed Mar 14 15:36:45 2018 +0100

    AMBARI-23224. Dependency check should ignore unknown services (#647)
---
 .../apache/ambari/server/topology/BlueprintValidatorImpl.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java
index fbd0e4b..569acae 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java
@@ -29,6 +29,7 @@ import java.util.Set;
 import org.apache.ambari.server.StaticallyInject;
 import org.apache.ambari.server.controller.internal.Stack;
 import org.apache.ambari.server.state.AutoDeployInfo;
+import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.DependencyConditionInfo;
 import org.apache.ambari.server.state.DependencyInfo;
 import org.apache.ambari.server.utils.SecretReference;
@@ -247,7 +248,13 @@ public class BlueprintValidatorImpl implements BlueprintValidator {
         }
 
         // dependent components from the stack definitions are only added if related services are explicitly added to the blueprint!
-        boolean isClientDependency = stack.getComponentInfo(dependency.getComponentName()).isClient();
+        ComponentInfo dependencyComponent = stack.getComponentInfo(dependency.getComponentName());
+        if (dependencyComponent == null) {
+          LOGGER.debug("The component [{}] is not associated with any known services, skipping dependency", dependency.getComponentName());
+          continue;
+        }
+
+        boolean isClientDependency = dependencyComponent.isClient();
         if (isClientDependency && !blueprint.getServices().contains(dependency.getServiceName())) {
           LOGGER.debug("The service [{}] for component [{}] is missing from the blueprint [{}], skipping dependency",
               dependency.getServiceName(), dependency.getComponentName(), blueprint.getName());

-- 
To stop receiving notification emails like this one, please contact
adoroszlai@apache.org.