All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit cf9096c3 authored by Leigh B Stoller's avatar Leigh B Stoller

Convert the approval threshold to a site variable.

parent 4522d247
......@@ -186,6 +186,7 @@ INSERT INTO sitevariables VALUES ('cnetwatch/pps_threshold',NULL,'50000','Packet
INSERT INTO sitevariables VALUES ('cnetwatch/bps_threshold',NULL,'500000000','Data rate in bits/sec in excess of which to log an alert (0 means do not generate data rate alerts)',0);
INSERT INTO sitevariables VALUES ('cnetwatch/mail_interval',NULL,'600','Interval in seconds at which to send email for all alerts logged during the interval (0 means do not send alert email)',0);
INSERT INTO sitevariables VALUES ('cnetwatch/mail_max',NULL,'1000','Maximum number of alert emails to send; after this alerts are only logged (0 means no limit to the emails)',0);
INSERT INTO sitevariables VALUES ('reservations/approval_threshold',NULL,'128','Maximum number of node hours for automatic approval of reservation requests (0 means no limit).',0);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
my $svar = 'reservations/approval_threshold';
DBQueryFatal("INSERT INTO `sitevariables` VALUES ".
"('$svar',NULL,'128',".
"'Maximum number of node hours for automatic approval of ".
"reservation requests (0 means no limit).',0)")
if (!TBSiteVarExists($svar));
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
......@@ -43,6 +43,7 @@ use Project;
use Reservation;
use WebTask;
use emutil;
use libEmulab;
sub usage()
{
......@@ -531,12 +532,19 @@ if ($clear || $clear_idx) {
exit( 0 );
}
# For now, auto-approve reservation requests up to 64 node-hours.
# For now, auto-approve reservation requests up to some number node-hours
# as defined by a nifty site variable.
# Later we'll probably want this threshold to vary based on the node type,
# how far into the future the reservation starts, existing approved
# reservations for the same project, the phase of the moon...
# who knows.
if( $count * ( $endtime - $starttime ) / 3600 <= 128 ) {
#
my $approval_threshold;
if (! GetSiteVar("reservations/approval_threshold", \$approval_threshold)) {
$approval_threshold = 128;
}
if ($approval_threshold == 0 ||
($count * ( $endtime - $starttime ) / 3600 <= $approval_threshold)) {
$approve = 1;
}
......
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