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

dsen 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 02dd59b  [AMBARI-24914] Block Ozone datanode co-location with HDFS 
Datanode when added though the API - additional fix (dsen) (#2654)
02dd59b is described below

commit 02dd59b6319a8f1ad15ad1c36dfb74aa7f74f3c4
Author: Dmitry Sen <d...@apache.org>
AuthorDate: Tue Nov 27 14:23:39 2018 +0200

    [AMBARI-24914] Block Ozone datanode co-location with HDFS Datanode when 
added though the API - additional fix (dsen) (#2654)
---
 .../server/controller/AmbariManagementControllerImpl.java    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 096fc83..465d1ee 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -757,7 +757,9 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
       throw new DuplicateResourceException(msg + names);
     }
 
-    validateExclusiveDependencies(hostComponentNames);
+    if (!isBlueprintProvisioned) {
+      validateExclusiveDependencies(hostComponentNames);
+    }
 
     // set restartRequired flag for  monitoring services
     setMonitoringServicesRestartRequired(requests);
@@ -788,7 +790,13 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 
             for (DependencyInfo dependencyInfo : dependencyInfos) {
               if ("host".equals(dependencyInfo.getScope()) && 
"exclusive".equals(dependencyInfo.getType())) {
-                Service depService = 
clusters.getCluster(clusterEntry.getKey()).getService(dependencyInfo.getServiceName());
+                Service depService;
+                try {
+                  depService = 
clusters.getCluster(clusterEntry.getKey()).getService(dependencyInfo.getServiceName());
+                } catch (ServiceNotFoundException e) {
+                  LOG.debug("Skipping dependency " + dependencyInfo + " for " 
+ serviceEntry.getKey() + " since the dependent service is not installed ");
+                  continue;
+                }
                 if (depService != null && 
depService.getServiceComponents().containsKey(dependencyInfo.getComponentName()))
 {
                   ServiceComponent dependentSC = 
depService.getServiceComponent(dependencyInfo.getComponentName());
                   if (dependentSC != null) {

Reply via email to