瀏覽代碼

AMBARI-17210. Return well formatted error response while deleting host with clients installed (ajit)

Ajit Kumar 9 年之前
父節點
當前提交
f6ba59a47f

+ 1 - 8
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java

@@ -924,16 +924,9 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
         List<ServiceComponentHost> list = cluster.getServiceComponentHosts(hostName);
 
         if (!list.isEmpty()) {
-
           List<String> componentsToRemove = new ArrayList<>();
           for (ServiceComponentHost sch : list) {
-            Service s = cluster.getService(sch.getServiceName());
-            ServiceComponent sc = s.getServiceComponent(sch.getServiceComponentName());
-
-            // Masters and Slaves must be deleted first. Clients are ok.
-            if (!sc.isClientComponent()) {
-              componentsToRemove.add(sch.getServiceComponentName());
-            }
+            componentsToRemove.add(sch.getServiceComponentName());
           }
 
           if (!componentsToRemove.isEmpty()) {