Changeset 729 for trunk/cgi-bin


Ignore:
Timestamp:
05/21/15 14:49:56 (10 years ago)
Author:
Kris Deugau
Message:

/trunk

Stub out subbranches of first major branch in mergeBlocks(). Fix up
some mispasted bits. See #8.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r728 r729  
    20812081  my @retlist;
    20822082
     2083  local $dbh->{AutoCommit} = 0;
     2084  local $dbh->{RaiseError} = 1;
     2085
    20832086  # Want to do all of the DB stuff in a transaction, to minimize data changing underfoot
    20842087  eval {
     
    21052108        });
    21062109
    2107     # Convert a bunch of pool IP allocations into "normal" netblock allocations
    2108     my $pool2alloc = $dbh->prepare(q{
    2109         INSERT INTO allocations (
    2110                 cidr,type,city, description, notes, circuitid, createstamp, modifystamp,
    2111                 privdata, custid, vrf, vlan, rdns, parent_id, master_id
    2112             )
    2113         SELECT
    2114                 ip, ? AS type, city, description, notes, circuitid, createstamp, modifystamp,
    2115                 privdata, custid, vrf, vlan, rdns, parent_id, master_id
    2116             FROM poolips
    2117             WHERE parent_id = ? AND available = 'n'
    2118         });
    2119 
    21202110    # Common actions
    21212111    my $peersth = $dbh->prepare("SELECT cidr,id,type,master_id FROM allocations WHERE parent_id = ? AND cidr <<= ?");
     
    21322122    if ($args{newtype} =~ /.[cm]/) {
    21332123      ## Container
     2124
     2125      # In case of merging a master block
     2126      my $mfbsth = $dbh->prepare("UPDATE freeblocks SET master_id = ? WHERE master_id = ?");
     2127
     2128      if ($args{scope} eq 'keepall') {
     2129      } elsif ($args{scope} =~ /^clear/) {
     2130      } elsif ($args{scope} eq 'mergepeer') { # should this just be an else?
     2131      } # scope
     2132
     2133      # Clean up free blocks
     2134      _compactFree($dbh, $prime);
    21342135
    21352136    } elsif ($args{newtype} =~ /.[dp]/) {
Note: See TracChangeset for help on using the changeset viewer.