Commit dbadd319 authored by Leigh Stoller's avatar Leigh Stoller

Remove hardwired emulab-ops/reloading/reloadpending strings from

scripts and move to libdb (hardwired in one place of many!).
parent d5eb4b14
......@@ -16,7 +16,7 @@ use Exporter;
qw ( NODERELOADING_PID NODERELOADING_EID NODEDEAD_PID NODEDEAD_EID
NODEBOOTSTATUS_OKAY NODEBOOTSTATUS_FAILED NODEBOOTSTATUS_UNKNOWN
NODESTARTSTATUS_NOSTATUS PROJMEMBERTRUST_NONE PROJMEMBERTRUST_USER
PROJMEMBERTRUST_ROOT DBLIMIT_NSFILESIZE
PROJMEMBERTRUST_ROOT DBLIMIT_NSFILESIZE NODERELOADPENDING_EID
EXPTSTATE_NEW EXPTSTATE_PRERUN EXPTSTATE_SWAPPED EXPTSTATE_SWAPPING
EXPTSTATE_ACTIVATING EXPTSTATE_ACTIVE EXPTSTATE_TESTING
......@@ -56,6 +56,7 @@ my $DBErrorString = "";
#
sub NODERELOADING_PID() { "emulab-ops"; }
sub NODERELOADING_EID() { "reloading"; }
sub NODERELOADPENDING_EID() { "reloadpending"; }
sub NODEDEAD_PID() { "emulab-ops"; }
sub NODEDEAD_EID() { "hwdown"; }
......
......@@ -27,13 +27,22 @@ my $TB = "@prefix@";
my $DBNAME = "@TBDBNAME@";
my $TBOPS = "@TBOPSEMAIL@";
# Testbed Support library
use lib "@prefix@/lib";
use libdb;
use libtestbed;
#
# This stuff should not be hardwired in.
# This should not be hardwired in.
#
my $CLASS = "pc"; # XXX: Needs a better approach.
my $RELOADPID = "emulab-ops";
my $RELOADEID = "reloading";
my $PENDINGEID = "reloadpending";
#
# These come from the library.
#
my $RELOADPID = NODERELOADING_PID;
my $RELOADEID = NODERELOADING_EID;
my $PENDINGEID = NODERELOADPENDING_EID;
my $os_load = "$TB/bin/os_load";
my $sched_reload= "$TB/sbin/sched_reload";
......@@ -52,11 +61,6 @@ $| = 1;
$ENV{'PATH'} = "/bin:/usr/bin:";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
# Testbed Support library
use lib "@prefix@/lib";
use libdb;
use libtestbed;
#
# Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments.
......
......@@ -31,12 +31,11 @@ use lib "@prefix@/lib";
use libdb;
#
# XXX This stuff should not be hardwired in. If you change these, be sure
# to update the test in doreboot() in tmcd/tmcd.c.
# These come from the library.
#
my $RELOADPID = "emulab-ops";
my $RELOADEID = "reloading";
my $PENDINGEID = "reloadpending";
my $RELOADPID = NODERELOADING_PID;
my $RELOADEID = NODERELOADING_EID;
my $PENDINGEID = NODERELOADPENDING_EID;
my $osload = "$TB/bin/os_load";
my $nalloc = "$TB/bin/nalloc";
......
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