Commit 204d3479 authored by Thomas Goirand's avatar Thomas Goirand

Repair building the ring.

parent 53e2c3db
......@@ -1100,7 +1100,8 @@ function build_swift_ring($con, $conf, $cluster_id, $verbose="no"){
exec($cmd, $output, $return_var);
$q = "SELECT machines.hostname AS hostname, INET_NTOA(ips.ip) AS ipaddr, machines.location_id AS locationid FROM ips,machines WHERE machines.cluster='$cluster_id' AND machines.role='swiftstore' AND ips.machine=machines.id ORDER BY ips.ip";
$q = "SELECT machines.id AS id, machines.hostname AS hostname, INET_NTOA(ips.ip) AS ipaddr, machines.location_id AS locationid, machines.install_on_raid AS install_on_raid, machines.raid_type AS raid_type, machines.raid_dev0 AS raid_dev0, machines.raid_dev1 AS raid_dev1, machines.raid_dev2 AS raid_dev2, machines.raid_dev3 AS raid_dev3 FROM ips,machines WHERE machines.cluster='$cluster_id' AND machines.role='swiftstore' AND ips.machine=machines.id ORDER BY ips.ip";
# if($verbose == "yes"){ print("Selecting: $q<br>\n"); ob_flush(); }else{ $out .= "Selecting: $q\n";}
$r = mysqli_query($con, $q);
$n = mysqli_num_rows($r);
for($i=0;$i<$n;$i++){
......@@ -1122,15 +1123,16 @@ function build_swift_ring($con, $conf, $cluster_id, $verbose="no"){
break;
default:
case "5":
die("Not supported yet...");
die("Raid configuratoin for $hostname not supported yet: RAID".$machine["raid_type"]);
break;
}
}
$r = mysqli_query($con, $q);
$n = mysqli_num_rows($r);
# if($verbose == "yes"){ print("Selecting: $q<br>\n"); ob_flush(); }else{ $out .= "Selecting: $q\n";}
$r2 = mysqli_query($con, $q);
$n2 = mysqli_num_rows($r2);
$blockdev_object_port = 6200;
for($j=0;$j<$n;$j++){
$blockdev = mysqli_fetch_array($r);
for($j=0;$j<$n2;$j++){
$blockdev = mysqli_fetch_array($r2);
$blockdev_devicename = $blockdev["hddname"];
$q = "SELECT swiftregions.id AS swiftregion FROM locations,swiftregions WHERE locations.id='$blockdev_locationid' AND swiftregions.name=locations.swiftregion";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment