Commit 8e11a390 authored by Gary Wong's avatar Gary Wong

Send more reservation nag e-mail to users so they can procmail it away.

We already told them about reservations within 24 hours.  Now tell them
again when the reservation actually starts.
parent 1305a3a6
......@@ -79,7 +79,49 @@ if (defined($options{"n"})) {
usage()
if (@ARGV);
# Check for current reservations BEFORE the 24 hour warning... that way,
# if the 24 hour one hasn't been sent for some reason (e.g., boss was
# down for a long time or they scheduled a reservation starting almost
# immediately), then we'll nag them only once.
my $query_result = DBQueryFatal( "SELECT r.idx, r.pid, r.nodes, r.type, " .
"r.end, u.usr_email FROM " .
"future_reservations AS r, users AS u " .
"WHERE r.uid_idx=u.uid_idx AND " .
"(r.notified IS NULL OR " .
"r.notified < r.start) AND " .
"r.start <= NOW()" );
while( my ($idx, $pid, $count, $type, $end, $email) =
$query_result->fetchrow_array() ) {
print STDERR "Reservation $idx for project $pid, $count x $type " .
"now-$end <$email> (now active!)\n" if( $debug );
next if( $impotent );
SENDMAIL( $email, "Reservation at $SITE is active",
"You have a current reservation at $SITE, with project\n" .
"$pid. $count $type nodes are now set aside for your\n" .
"project, until $end.\n" .
"\n" .
"If you do not intend to use these resources, please\n" .
"cancel this reservation as soon as possible, since\n" .
"the nodes are now unavailable to other users for\n" .
"the duration of your reservation.\n" .
"\n" .
"Please note that we make no guarantees about the\n" .
"availability or suitability of these nodes for your\n" .
"experiment(s).\n" .
"\n" .
"PLEASE NOTE: Reservations are an experimental\n" .
"testbed feature under active development. Until\n" .
"further notice, you should expect reservation\n" .
"system failures. Please send reports about the\n" .
"reservation system to $TBOPS.\n" .
"Thank you for your assistance in debugging this\n" .
"feature!\n" );
DBQueryFatal( "UPDATE future_reservations SET notified=NOW() WHERE idx=$idx" );
}
$query_result = DBQueryFatal( "SELECT r.idx, r.pid, r.nodes, r.type, " .
"r.start, r.end, u.usr_email FROM " .
"future_reservations AS r, users AS u " .
"WHERE r.uid_idx=u.uid_idx AND " .
......
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