Changeset 746
- Timestamp:
- 06/16/15 17:56:30 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r745 r746 2137 2137 # Convert leaf allocations into free blocks. 2138 2138 # clearpeer 2139 # Keep subs of the original 2140 # Convert assigned IPs from pools into subs.2141 # Convert unused IPs from pools into free blocks.2142 # Convert leaf allocations into free blocks.2139 # Keep subs of the original (if it was a container). 2140 # Convert assigned IPs from the original pool into subs (if it was a pool). 2141 # Convert unused IPs from the original pool into free blocks (if it was a pool). 2142 # Delete all peers and their subs aside from the original. 2143 2143 # clearall 2144 2144 # Delete all peers, subs and IPs. … … 2272 2272 $mfbsth->execute($binfo->{master_id}, $m_id) if $peertype eq 'mm'; 2273 2273 # capture block for return 2274 push @retlist, { block => $peercidr, m type => $disp_alloctypes{$peertype}};2274 push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype }; 2275 2275 } 2276 2276 … … 2301 2301 undef, ($peercidr, 'm', $prime, $prime) ) if $binfo->{type} eq 'mm'; 2302 2302 # capture block for return 2303 push @retlist, { block => $peercidr, m type => $disp_alloctypes{$peertype}};2303 push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype }; 2304 2304 } 2305 2305 if ($args{scope} eq 'clearall') { … … 2346 2346 $mfbsth->execute($binfo->{master_id}, $m_id) if $peertype eq 'mm'; 2347 2347 # capture block for return 2348 push @retlist, { block => $peercidr, m type => $disp_alloctypes{$peertype}};2348 push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype }; 2349 2349 } # merge peers 2350 2350 # update the primary allocation info. Do this last so we don't stomp extra data-retrieval in the loop above … … 2363 2363 if ($args{scope} eq 'keepall') { 2364 2364 # Convert all mergeable allocations and subs to chunks of pool IP assignments 2365 push @retlist, @{ _toPool($dbh, $prime, $newblock, $args{newtype} ) };2365 push @retlist, @{ _toPool($dbh, $prime, $newblock, $args{newtype}, 1) }; 2366 2366 2367 2367 } elsif ($args{scope} =~ /^clear/) { … … 2374 2374 _deleteCascade($dbh, $peer_id, 0); 2375 2375 # Capture block for return 2376 push @retlist, { block => $peercidr, m type => $disp_alloctypes{$peertype}};2376 push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype }; 2377 2377 } 2378 2378 if ($args{scope} eq 'clearall') { … … 2385 2385 } else { 2386 2386 # Convert (subs of) self if not a leaf. 2387 _toPool($dbh, $prime, $newblock, $args{newtype}) unless $binfo->{type} =~ /.[enr]/; 2387 push @retlist, @{ _toPool($dbh, $prime, $newblock, $args{newtype}, 1) } 2388 unless $binfo->{type} =~ /.[enr]/; 2388 2389 } # scope ne 'clearall' 2389 2390 … … 2393 2394 next if $peer_id == $prime; # don't delete the block we're turning into the pool allocation 2394 2395 # Capture block for return 2395 push @retlist, { block => $peercidr, m type => $disp_alloctypes{$peertype}};2396 push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype }; 2396 2397 next unless $peertype =~ /.[enr]/; 2397 2398 # Don't need _deleteCascade(), since we'll just be deleting the freshly … … 2424 2425 _deleteCascade($dbh, $peer_id, 0); 2425 2426 # Capture block for return 2426 push @retlist, { block => $peercidr, m type => $disp_alloctypes{$peertype}};2427 push @retlist, { block => $peercidr, mdisp => $disp_alloctypes{$peertype}, mtype => $peertype }; 2427 2428 } 2428 2429 # Delete any subs of $prime as well
Note:
See TracChangeset
for help on using the changeset viewer.