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

Check node/type attributes for autoapprove limit when its a specific node.

parent 4923552a
......@@ -566,15 +566,11 @@ if (! ($pending || $approve)) {
# Check for an override attribute on the node type. Here zero really means
# zero instead of unlimited. As above, this limit is node hours.
#
my $limit;
my $nodetype = NodeType->Lookup($type);
if (defined($nodetype)) {
if (defined($nodetype->GetAttribute("reservation_autoapprove_limit"))) {
my $limit = $nodetype->GetAttribute("reservation_autoapprove_limit");
if (($count * ( $endtime - $starttime ) / 3600) > $limit) {
$approve = 0;
}
}
$limit = $nodetype->GetAttribute("reservation_autoapprove_limit");
}
else {
# Lets see if type is really a node ID.
......@@ -582,6 +578,15 @@ if (! ($pending || $approve)) {
if (!defined($node)) {
fatal("Could not look up node type");
}
$node->NodeAttribute("reservation_autoapprove_limit", \$limit);
if (!defined($limit)) {
$limit = $node->NodeTypeAttribute("reservation_autoapprove_limit");
}
}
if (defined($limit)) {
if (($count * ( $endtime - $starttime ) / 3600) > $limit) {
$approve = 0;
}
}
}
......
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