Commit a7b4249d authored by Christopher Alfeld's avatar Christopher Alfeld

Fix for ALWAYSUP nodes and fix for switches with interface entries.

In detail:

1. Added TBDB_NODESTATE_ALWAYSUP to libdb.pm for representing the ALWAYSUP
eventstate.

2. Modified free node calculation in ptopgen to include ALWAYSUP nodes.

3. Added code to ptopgen to correctly handle the case of a NULL iface
column, which happens when switches have interface (as they do in
Wisconsin), but assign_wrapper expects (null) for their iface rather than
"".
parent 86e42420
......@@ -92,7 +92,7 @@ use vars qw(@ISA @EXPORT);
TBDB_NODESTATE_RELOADSETUP TBDB_NODESTATE_RELOADING
TBDB_NODESTATE_RELOADDONE TBDB_NODESTATE_UNKNOWN
TBDB_NODESTATE_PXEWAIT TBDB_NODESTATE_PXEWAKEUP
TBDB_NODESTATE_PXEBOOTING
TBDB_NODESTATE_PXEBOOTING TBDB_NODESTATE_ALWAYSUP
TBDB_NODEOPMODE_NORMAL TBDB_NODEOPMODE_DELAYING
TBDB_NODEOPMODE_UNKNOWNOS TBDB_NODEOPMODE_RELOADING
......@@ -467,6 +467,7 @@ sub TBDB_TBEVENT_EXPTSTATE { "TBEXPTSTATE"; }
# For nodes, we use this set of events.
#
sub TBDB_NODESTATE_ISUP() { "ISUP"; }
sub TBDB_NODESTATE_ALWAYSUP() { "ALWAYSUP"; }
sub TBDB_NODESTATE_REBOOTED() { "REBOOTED"; }
sub TBDB_NODESTATE_REBOOTING() { "REBOOTING"; }
sub TBDB_NODESTATE_SHUTDOWN() { "SHUTDOWN"; }
......
......@@ -290,7 +290,8 @@ else {
# the ordinary free condition for a local node.
my $free_condition = "(b.node_id is null and ".
" (np.eventstate='" . TBDB_NODESTATE_ISUP . "' or ".
" np.eventstate='" . TBDB_NODESTATE_PXEWAIT . "')) ";
" np.eventstate='" . TBDB_NODESTATE_PXEWAIT . "' or ".
" np.eventstate='" . TBDB_NODESTATE_ALWAYSUP . "')) ";
# if the user has specified an exempt pid/eid,
# then view any node which is reserved to that experiment as available.
......@@ -780,7 +781,11 @@ exit(0);
sub get_iface {
($node,$card,$port) = @_;
if (defined($interfacemap{"$node:$card:$port"})) {
return $interfacemap{"$node:$card:$port"};
if ($interfacemap{"$node:$card:$port"} eq "") {
return "(null)";
} else {
return $interfacemap{"$node:$card:$port"};
}
} else {
# shark hack
if ($node =~ /^sh/) {
......
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