Commit 1159ca52 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Make sure that TMNODEID is created before used!

parent 649b475c
......@@ -569,6 +569,39 @@ sub dorole()
return 0;
}
#
# Get the nodeid
#
sub donodeid()
{
my $nodeid;
my @tmccresults;
if (tmcc(TMCCCMD_NODEID, undef, \@tmccresults) < 0) {
warn("*** WARNING: Could not get nodeid from server!\n");
return -1;
}
return 0
if (! @tmccresults);
#
# There should be just one string. Ignore anything else.
#
if ($tmccresults[0] =~ /([-\w]*)/) {
$nodeid = $1;
}
else {
warn "*** WARNING: Bad nodeid line: $tmccresults[0]";
return -1;
}
system("echo '$nodeid' > ". TMNODEID);
if ($?) {
warn "*** WARNING: Could not write nodeid to " . TMNODEID() . "\n";
}
return 0;
}
#
# Parse the router config and return a hash. This leaves the ugly pattern
# matching stuff here, but lets the caller do whatever with it (as is the
......@@ -1687,6 +1720,11 @@ sub bootsetup()
#
dorole();
#
# And the nodeid.
#
donodeid();
return ($pid, $eid, $vname);
}
......
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