Commit 97a610b1 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add a method to clear unused reserved vlan tags; these are tags

that are in the reserved_vlantags table, but are not referenced
by an actual lan object in the lans table.
parent 6cf701f9
......@@ -3540,6 +3540,31 @@ sub ClearReservedVlanTags($)
return 0;
}
#
# This is slightly different then above. Rather then releasing all
# reserved tags, we release only the tags that are "dangling"; these
# are tags in the reserved_vlantags table, but without a corresonding
# entry in the lans table. Used from the Protogeni code, when
# releasing a ticket (which reserved some tags that will not be used).
#
sub ClearUnusedReservedVlanTags($)
{
my ($self) = @_;
# Must be a real reference.
return -1
if (! ref($self));
my $idx = $self->idx();
return -1
if (! DBQueryWarn("delete r from reserved_vlantags as r ".
"left join lans as l on l.lanid=r.lanid ".
"where l.lanid is null and r.exptidx='$idx'"));
return 0;
}
#
# Does experiment have any program agents.
#
......
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