You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2012/06/17 03:20:26 UTC
svn commit: r1351030 - in /incubator/ambari/trunk/hmc/php/frontend:
addNodes.php commandUtils.php
Author: yusaku
Date: Sun Jun 17 01:20:26 2012
New Revision: 1351030
URL: http://svn.apache.org/viewvc?rev=1351030&view=rev
Log:
AMBARI-536. Duplicate hosts not recognized due to case sensitive matching (Contributed by hitesh)
Modified:
incubator/ambari/trunk/hmc/php/frontend/addNodes.php
incubator/ambari/trunk/hmc/php/frontend/commandUtils.php
Modified: incubator/ambari/trunk/hmc/php/frontend/addNodes.php
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/hmc/php/frontend/addNodes.php?rev=1351030&r1=1351029&r2=1351030&view=diff
==============================================================================
--- incubator/ambari/trunk/hmc/php/frontend/addNodes.php (original)
+++ incubator/ambari/trunk/hmc/php/frontend/addNodes.php Sun Jun 17 01:20:26 2012
@@ -113,7 +113,6 @@ if (!$freshInstall) {
if (!array_key_exists($hostInfo["clusterName"], $duplicateHosts)) {
$duplicateHosts[$hostInfo["clusterName"]] = array();
}
-
array_push($duplicateHosts[$hostInfo["clusterName"]],
$hostInfo["hostName"]);
}
@@ -121,6 +120,8 @@ if (!$freshInstall) {
$numDupHosts = count($duplicateHosts);
$numNewHosts = count($newHosts);
if ($numDupHosts != 0) {
+ $logger->log_warn("Trying to add duplicate nodes to the cluster, dups="
+ . print_r($duplicateHosts, true));
print (json_encode(array("result" => 3, "error" => "Some hosts in the given file are already being used in cluster", "hosts" => $duplicateHosts)));
return;
}
Modified: incubator/ambari/trunk/hmc/php/frontend/commandUtils.php
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/hmc/php/frontend/commandUtils.php?rev=1351030&r1=1351029&r2=1351030&view=diff
==============================================================================
--- incubator/ambari/trunk/hmc/php/frontend/commandUtils.php (original)
+++ incubator/ambari/trunk/hmc/php/frontend/commandUtils.php Sun Jun 17 01:20:26 2012
@@ -37,10 +37,10 @@ function readHostsFile($hostsFile) {
$hostSuffix = $matches[4];
for ($i = $matches[2]; $i <= $matches[3]; $i++) {
$newH = $hostPrefix . $i . $hostSuffix;
- $hosts[] = $newH;
+ $hosts[] = strtolower($newH);
}
} else {
- $hosts[] = $h;
+ $hosts[] = strtolower($h);
}
}
}