Commit b62dcd46 authored by Leigh Stoller's avatar Leigh Stoller

Another change for user alloc switches; when adding, look to see if

there is an adminmfs, instead of defaulting to null. The ONIE based
switches operate more like normal nodes wrt reload/admin MFSs
parent a074ddba
......@@ -417,11 +417,7 @@ sub Create($$$$)
print STDERR "*** No virtnode_capacity for $type! Using zero.\n";
$virtnode_capacity = 0;
}
if ($typeinfo->isswitch()) {
$osid = "NULL";
$opmode = "ALWAYSUP";
}
elsif ($isremote || $typeinfo->isfakenode()) {
if ($isremote || $typeinfo->isfakenode()) {
$osid = "NULL";
$opmode = "";
......@@ -440,25 +436,31 @@ sub Create($$$$)
}
}
else {
if ($typeinfo->adminmfs_osid(\$adminmfs_osid)) {
print STDERR "*** No adminmfs osid for $type!\n";
return undef;
if ($typeinfo->adminmfs_osid(\$adminmfs_osid) == 0) {
# Find object for the adminfs.
if (defined($adminmfs_osid)) {
$adminmfs = OSImage->Lookup($adminmfs_osid);
}
else {
$adminmfs = OSImage->Lookup(TBOPSPID(), $MFS_INITIAL);
}
if (!defined($adminmfs)) {
print STDERR
"*** Could not find OSImage object for adminmfs!\n";
return undef;
}
$osid = $adminmfs->osid();
$osid_vers = $adminmfs->version();
$opmode = $adminmfs->op_mode();
}
# Find object for the adminfs.
if (defined($adminmfs_osid)) {
$adminmfs = OSImage->Lookup($adminmfs_osid);
elsif ($typeinfo->isswitch()) {
$osid = "NULL";
$opmode = "ALWAYSUP";
}
else {
$adminmfs = OSImage->Lookup(TBOPSPID(), $MFS_INITIAL);
}
if (!defined($adminmfs)) {
print STDERR
"*** Could not find OSImage object for adminmfs!\n";
print STDERR "*** No adminmfs osid for $type!\n";
return undef;
}
$osid = $adminmfs->osid();
$osid_vers = $adminmfs->version();
$opmode = $adminmfs->op_mode();
}
}
else {
......
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