Commit 53025de5 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

A few little bug fixes, which came uo during elabinelab and shared

node testing.

Also stub in the subnode support; should work as well as it did in the
original version of os_setup, since subnodes were always ignored.
parent 906ba9b5
......@@ -24,6 +24,7 @@ use libtestbed;
use libreboot;
use libosload;
use Node;
use NodeType;
use libtblog;
use English;
use Data::Dumper;
......@@ -781,9 +782,16 @@ sub NewType($$)
#
# These special cases will eventually be encoded in the DB.
# Note that type might be a class, and so Lookup() returns nothing.
#
$type = "protogeni"
if ($type eq "pcfedphys" || $type eq "pcfed");
my $typeinfo = NodeType->Lookup($type);
if ($type eq "pcfedphys" || $type eq "pcfed") {
$type = "protogeni";
}
elsif (defined($typeinfo) && $typeinfo->issubnode()) {
$type = "subnode";
}
my $packname = "libossetup_${type}";
my $newtype = eval { $packname->New($self); };
......@@ -812,8 +820,12 @@ sub TypeLookup($$)
#
# These special cases will eventually be encoded in the DB.
#
$type = "protogeni"
if ($type eq "pcfedphys" || $type eq "pcfed");
if ($type eq "pcfedphys" || $type eq "pcfed") {
$type = "protogeni";
}
elsif ($node->issubnode()) {
$type = "subnode";
}
return $self->{'TYPECACHE'}->{$type}
if (exists($self->{'TYPECACHE'}->{$type}));
......@@ -1517,6 +1529,36 @@ use English;
use Data::Dumper;
use overload ('""' => 'Stringify');
#
# A constructor for an object to handle all nodes of this type.
#
sub New($$) {
my ($class, $parent) = @_;
my $self = $class->SUPER::New("subnode", $parent);
bless($self, $class);
return $self;
}
sub AddNode($$)
{
my ($self, $node) = @_;
print "Will skip subnode $node ISUP wait.\n";
return $self->SUPER::AddNode($node);
}
#
# We do not currently do anything with subnodes; no waiting for ISUP.
#
sub Volunteers($)
{
my ($self) = @_;
return ();
}
#####################################################################
#
# All protogeni nodes.
......
......@@ -486,6 +486,11 @@ foreach (keys(%{ $MyStruct->failedlist() })) {
foreach (keys(%{ $MyStruct->nodelist() })) {
my $node = $MyStruct->node($_);
my $osinfo = $node->_bootosinfo();
# Was not setup to do anything, so ignore.
next
if (!defined($osinfo));
my $osid = $osinfo->osid();
my $type = $node->type();
$total{$osid}{any_type}++;
......
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