Commit 8f1e9aea authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add oneshot update to create the holding experiment where reserved

nodes live before a ticket is redeemed.
parent d4417202
......@@ -30,6 +30,10 @@ my $DBUPDATE = "$TB/sbin/dbupdate";
my $WAP = "$TB/sbin/withadminprivs";
my $SACERT = "$TB/etc/genisa.pem";
my $CMCERT = "$TB/etc/genicm.pem";
my $geniuserid = "geniuser";
my $geniprojid = "GeniSlices";
my $SUDO = "/usr/local/bin/sudo";
my $BATCHEXP = "$TB/bin/batchexp";
# un-taint path
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin:/usr/site/bin';
......@@ -48,6 +52,7 @@ $| = 1;
use lib "@prefix@/lib";
use libtestbed;
use libdb qw(TBSetSiteVar TBSiteVarExists TBGetSiteVar);
use Experiment;
use GeniDB;
use GeniCertificate;
......@@ -108,6 +113,16 @@ sub OneShot()
}
TBSetSiteVar('protogeni/cm_uuid', $certificate->uuid());
}
my $experiment = Experiment->Lookup($geniprojid, "reservations");
if (!defined($experiment)) {
system("$SUDO -u $geniuserid $WAP $BATCHEXP ".
" -q -i -k -w -f -n -S 'System Experiment' ".
" -L 'System Experiment' ".
" -E 'Holding Pattern for Reservations - DO NOT DELETE' ".
" -p $geniprojid -e reservations -h " . NewUUID());
fatal("Could not create create reservations holding experiment")
if ($?);
}
}
sub fatal($)
......
Supports Markdown
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