Commit ee486a42 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Couple of bug fixes:

* Use the "role" slot of the interfaces table, instead of joining with
  node_type, to find the control interface. Must do this inside an
  inner Elab of course, since the node_types table does not reflect
  how assign selected the interface we use for the "control" network.

* Use !is_numeric() instead of is_string() to determine if the naming
  patter in alpha based instead of number based ("1" is a string).
parent 5722b3e3
......@@ -143,10 +143,10 @@ function guess_IP ($prefix, $number) {
}
#
# We want to be able to handle both numeric and character 'number's - figure
# out which we have
# We want to be able to handle both numeric and character 'number's
# Figure out which we have
#
if (is_string($number)) {
if (! is_numeric($number)) {
$using_char = 1;
$number = ord($number);
} else {
......@@ -166,10 +166,10 @@ function guess_IP ($prefix, $number) {
} else {
$node = $prefix . $i;
}
$query_result = DBQueryFatal("select IP from interfaces as i " .
"left join nodes as n on i.node_id = n.node_id left join " .
"node_types as nt on n.type = nt.type " .
"where n.node_id='$node' and i.iface = nt.control_iface");
$query_result =
DBQueryFatal("select IP from interfaces as i " .
"where i.node_id='$node' and ".
" i.role='" . TBDB_IFACEROLE_CONTROL . "'");
if (mysql_num_rows($query_result)) {
$row = mysql_fetch_array($query_result);
$IP = $row[IP];
......
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