Commit 6ff2610b authored by Christopher Alfeld's avatar Christopher Alfeld
Browse files

Added updating of virt_names table.

parent cab775f0
......@@ -524,4 +524,24 @@ if (! &ir_exists("/ip")) {
}
}
# Update virt_names table
# Clear table
foreach (split("\n",$ip_section)) {
($src,$dst,$ip) = split;
$sth = $dbh->prepare("DELETE from virt_names where src_node_id = \"$src\"");
$sth->execute;
$sth->finish;
}
foreach (split("\n",$ip_section)) {
($src,$dst,$ip) = split;
$sth = $dbh->prepare("SELECT src_node_id from virt_names where src_node_id = \"$src\" and dest_node_id = \"$dst\"");
$sth->execute;
$i = $sth->rows();
$sth->finish;
$sth=$dbh->prepare("INSERT into virt_names (src_node_id,dest_node_id,lindex,ip) values (\"$src\",\"$dst\",$i,\"$ip\")");
$sth->execute;
$sth->finish;
}
0;
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