Commit 0dafce90 authored by Leigh Stoller's avatar Leigh Stoller

Minor change for Powder; add a blackbox=1 attribute to a node type to

tell the CM that we want the type default OS, which might be just an
OSID. This avoids having to specify the OS or use setUseTypeDefaultImage
in the geni-lib script.
parent 500882bd
#!/usr/bin/perl -wT
#
# Copyright (c) 2005-2014, 2016, 2017 University of Utah and the Flux Group.
# Copyright (c) 2005-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -443,6 +443,9 @@ sub isdedicatedremote($;$) {
sub isfakenode($;$) {
return GetAttribute($_[0], "fakenode", $_[1]);
}
sub isblackbox($;$) {
return GetAttribute($_[0], "blackbox", $_[1]);
}
sub control_interface($;$) { return control_iface($_[0], $_[1]); }
#
......
......@@ -1694,6 +1694,31 @@ sub GetTicketAuxAux($)
goto bad;
}
}
if (!defined($osname) && defined($pctype)) {
my $nodetype = NodeType->Lookup($pctype);
if (defined($nodetype) && $nodetype->isblackbox()) {
my $default_osid = $nodetype->default_osid();
if (!defined($default_osid)) {
print STDERR "Blackbox node type $pctype but no ".
"default_osid defined for it.\n";
}
else {
my $default_osinfo = OSImage->Lookup($default_osid);
if (!defined($default_osinfo)) {
print STDERR "Blackbox node type $pctype but cannot ".
"lookup default_osid defined for it.\n";
}
else {
$osname = $default_osinfo->osname()
}
}
if (!defined($osname)) {
$response = GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Blackbox OS error");
goto bad;
}
}
}
#
# If no osname, check for protogeni default osname
#
......@@ -3078,7 +3103,8 @@ sub GetTicketAuxAux($)
$rlatency = 0.0;
$lossrate = 0.0;
$rlossrate = 0.0;
$nobwshaping= 1;
$nobwshaping = 1;
$uselinkdelay = 0;
}
my $virtlan =
......
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