Commit cae8a130 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add a little bit of output when creating a widearea node, and also

send the email to the log (was previously sent only when coming from
the web).
Add update_accounts=1 when creating the physnode.
parent 58ba5cb5
...@@ -199,6 +199,7 @@ if (!defined($nodevtype)) { ...@@ -199,6 +199,7 @@ if (!defined($nodevtype)) {
# #
# Enter the records # Enter the records
# #
print "Creating widearea node $nodename ...\n";
DBQueryFatal("insert into nodes ". DBQueryFatal("insert into nodes ".
"(node_id, type, phys_nodeid, role, priority, ". "(node_id, type, phys_nodeid, role, priority, ".
" status, op_mode, def_boot_osid) ". " status, op_mode, def_boot_osid) ".
...@@ -209,12 +210,13 @@ for ($i = 1; $i < 9; $i++) { ...@@ -209,12 +210,13 @@ for ($i = 1; $i < 9; $i++) {
my $priority = ($nextpri * 100) + $i; my $priority = ($nextpri * 100) + $i;
$nodevname = "v${nodename}-${i}"; $nodevname = "v${nodename}-${i}";
print "Creating widearea virtual node $nodevname ...\n";
DBQueryFatal("insert into nodes ". DBQueryFatal("insert into nodes ".
"(node_id, type, phys_nodeid, role, priority, ". "(node_id, type, phys_nodeid, role, priority, ".
" status, op_mode, def_boot_osid) ". " status, op_mode, def_boot_osid, update_accounts) ".
"values ('$nodevname', '$nodevtype', '$nodename', ". "values ('$nodevname', '$nodevtype', '$nodename', ".
" 'virtnode', $priority, 'down', 'NORMAL', ". " 'virtnode', $priority, 'down', 'NORMAL', ".
" '$defosid') "); " '$defosid', 1) ");
} }
DBQueryFatal("insert into interfaces ". DBQueryFatal("insert into interfaces ".
...@@ -242,23 +244,22 @@ DBQueryFatal("insert into reserved ". ...@@ -242,23 +244,22 @@ DBQueryFatal("insert into reserved ".
# #
# Lets log it. # Lets log it.
# #
if ($fromweb) { SENDMAIL($TBLOGS, "New WA node created",
SENDMAIL($TBLOGS, "New WA node created", "New Wide Area node has been created.\n".
"New Wide Area node has been created.\n". "\n".
"\n". "Type: $nodetype\n".
"Type: $nodetype\n". "Name: $nodename\n".
"Name: $nodename\n". "IP: $nodeip\n".
"IP: $nodeip\n". "Vtype: $nodevtype\n".
"Vtype: $nodevtype\n". "Vname: $nodevname (actually the last vnode)\n".
"Vname: $nodevname (actually the last vnode)\n". "Nickname: $nickname\n",
"Nickname: $nickname\n", $TBOPS);
$TBOPS);
}
# #
# update the named maps. Do it in the background since we do not # update the named maps. Do it in the background since we do not
# want to hold up the caller. # want to hold up the caller.
# #
print "Forcing a named map update ...\n";
my $logname = TBMakeLogname("newwanode"); my $logname = TBMakeLogname("newwanode");
if (TBBackGround($logname)) { if (TBBackGround($logname)) {
# #
......
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