incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vik...@apache.org
Subject svn commit: r1347215 - in /incubator/ambari/branches/ambari-186: CHANGES.txt hmc/php/frontend/uninstall.php
Date Thu, 07 Jun 2012 00:28:25 GMT
Author: vikram
Date: Thu Jun  7 00:28:25 2012
New Revision: 1347215

URL: http://svn.apache.org/viewvc?rev=1347215&view=rev
Log:
AMBARI-409. Uninstall does not get full list of hosts. (Contributed by Vikram)

Modified:
    incubator/ambari/branches/ambari-186/CHANGES.txt
    incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall.php

Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1347215&r1=1347214&r2=1347215&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Thu Jun  7 00:28:25 2012
@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-409. Uninstall does not get full list of hosts. (Vikram)
+
   AMBARI-410. Need to move the creation of cluster directory for hosting the key file and
the nodes file to add nodes. (Vikram)
 
   AMBARI-408. HDPJobTracker cluster in ganglia has multiple nodes (Suhas via Vikram)

Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall.php?rev=1347215&r1=1347214&r2=1347215&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstall.php Thu Jun  7 00:28:25
2012
@@ -3,6 +3,7 @@ include_once '../util/Logger.php';
 include_once '../conf/Config.inc';
 include_once 'localDirs.php';
 include_once "../util/lock.php";
+include_once "../util/util.php";
 include_once '../db/HMCDBAccessor.php';
 include_once "../orchestrator/HMC.php";
 include_once "../db/OrchestratorDB.php";
@@ -25,6 +26,28 @@ if ($action == "wipeOut") {
   $wipeout = FALSE;
 }
 
+////// need to generate the hosts.txt file with all the good nodes in the cluster
+$allHostsInfo = $dbAccessor->getAllHostsInfo($clusterName, 
+  array("=" => array ( "discoveryStatus" => "SUCCESS"));
+if ($allHostsInfo["result"] != 0 ) {
+  $logger->log_error("Got error while getting hostsInfo ".$allHostsInfo["error"]);
+  print json_encode($allHostsInfo);
+  return;
+}
+
+$hostFileName = getHostsFilePath($clusterName);
+
+$hostFileHdl = fopen($hostFileName, "w");
+
+foreach ($allHostsInfo["hosts"] as $hostInfo) {
+  fwrite($hostFileHdl, "$hostInfo["hostName"]\n");
+}
+
+fclose($hostFileHdl);
+$logger->log_debug("HOST FILE IS NOW POPULATED GO AHEAD!!");
+sleep(5);
+////// end of generating new file
+
 $logger->log_debug("Uninstall got wipeout value $wipeout");
 
 $dbPath = $GLOBALS["DB_PATH"];



Mime
View raw message