Selaa lähdekoodia

AMBARI-909. Pass correct cluster info to Action Manager. (Contributed by hitesh)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1401936 13f79535-47bb-0310-9956-ffa450edef68
Hitesh Shah 12 vuotta sitten
vanhempi
commit
43470a61ee

+ 2 - 0
AMBARI-666-CHANGES.txt

@@ -357,6 +357,8 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-909. Pass correct cluster info to Action Manager. (hitesh)
+
   AMBARI-904. Ensure state changes only happen after actionmanager persists
   actions. (hitesh)
 

+ 6 - 7
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java

@@ -57,6 +57,7 @@ import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostInstallEvent;
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStartEvent;
 import org.apache.ambari.server.state.svccomphost.ServiceComponentHostStopEvent;
+import org.apache.ambari.server.utils.StageUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -751,7 +752,8 @@ public class AmbariManagementControllerImpl implements
     return stage;
   }
 
-  private void createHostAction(Stage stage, ServiceComponentHost scHost,
+  private void createHostAction(Cluster cluster,
+      Stage stage, ServiceComponentHost scHost,
       Map<String, Config> configs,
       RoleCommand command,
       long nowTimestamp,
@@ -769,11 +771,8 @@ public class AmbariManagementControllerImpl implements
     Map<String, List<String>> clusterHostInfo =
         new TreeMap<String, List<String>>();
 
-    // TODO hack alert
-    List<String> slaveHostList = new ArrayList<String>();
-    slaveHostList.add("localhost");
-    clusterHostInfo.put("slave_hosts", slaveHostList);
-    execCmd.setClusterHostInfo(clusterHostInfo);
+    execCmd.setClusterHostInfo(
+        StageUtils.getClusterHostInfo(cluster));
 
     // TODO do something from configs here
     Map<String, Map<String, String>> configurations =
@@ -1243,7 +1242,7 @@ public class AmbariManagementControllerImpl implements
           }
 
           Map<String, Config> configs = scHost.getDesiredConfigs();
-          createHostAction(stage, scHost, configs, roleCommand,
+          createHostAction(cluster, stage, scHost, configs, roleCommand,
             nowTimestamp, event);
         }
       }