Changeset 747


Ignore:
Timestamp:
06/17/15 16:42:05 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Add first subbranch of "merge to pool" rDNS calls - keepall/mergepeer.
See #8.

File:
1 edited

Legend:

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

    r746 r747  
    24922492    } # scope, !keepall
    24932493
     2494  } elsif ($args{newtype} =~ /.[dp]/) {
     2495    # Merge to pool
     2496
     2497    # Resize rDNS template for $prime
     2498    _rpc('resizeTemplate', oldcidr => "$binfo->{block}", newcidr => $newblock->network.'', rpcuser => $args{user});
     2499
     2500    if ($args{scope} eq 'keepall' || $args{scope} eq 'mergepeer') {
     2501      # Assemble a list of blocks to convert from template to individual records...
     2502      my @convlist;
     2503      my @dellist;
     2504      foreach my $mblock (@retlist) {
     2505        next if $mblock->{block} =~ $newblock;
     2506        if ($mblock->{mtype} =~ /.[cmdp]/) {
     2507          # Container and pool templates get deleted
     2508          push @dellist, $mblock->{block};
     2509        } else {
     2510          # Not-containers get converted to per-IP reverse records
     2511          push @convlist, $mblock->{block};
     2512        }
     2513      }
     2514      # And do the calls.
     2515      _rpc('delRevSet', cidrlist => join(',', @dellist), rpcuser => $args{user}, delforward => 'y', delsubs => 'n',
     2516          parpatt => $pinfo->{rdns});
     2517      _rpc('templatesToRecords', templates => \@convlist, rpcuser => $args{user});
     2518
     2519    } # scope eq 'keepall' || 'mergepeer'
     2520
    24942521  } # type grouping for rDNS calls
    2495 
    24962522
    24972523  return \@retlist;
Note: See TracChangeset for help on using the changeset viewer.