Changeset 587 for trunk/cgi-bin


Ignore:
Timestamp:
01/17/13 16:19:47 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Minor cleanup of current RPC calls for consistency. See #1.

  • $rpc_url is checked in _rpc(), don't (usually) need to check before calling
  • remove a debugging print
  • remove a dangling local Frontier::Client object
File:
1 edited

Legend:

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

    r586 r587  
    121121    $errstr = $@;
    122122    $errstr =~ s/Fault returned from XML RPC Server, fault code 4: error executing RPC `dnsdb.$rpcsub'\.\s//;
    123 print "error!  $errstr\n";
    124123  }
    125124  $rpccount++;
     
    381380          state => 1,   # could make them globally configurable maybe
    382381        );
    383         if (!_rpc('addRDNS', %rpcargs)) {
     382        if ($rpc_url && !_rpc('addRDNS', %rpcargs)) {
    384383          push @fails, ("$subzone" => $errstr);
    385384        }
     
    10341033
    10351034    # now we do the DNS dance for netblocks, if we have an RPC server to do it with.
    1036     _rpc('addOrUpdateRevRec', cidr => "$args{cidr}", name => $args{rdns}, rpcuser => $args{user})
    1037       if $rpc_url;
     1035    _rpc('addOrUpdateRevRec', cidr => "$args{cidr}", name => $args{rdns}, rpcuser => $args{user});
    10381036
    10391037    return ('OK', 'OK');
     
    14951493
    14961494  if ($rpc_url) {
    1497     # Make an object to represent the XML-RPC server.
    1498     my $server = Frontier::Client->new(url => $rpc_url, debug => 0);
    1499     my $result;
    1500 
    15011495    # Use the first /16 or /24, rather than dithering over which sub-/14 /16
    15021496    # or sub-/19 /24 to retrieve - it's the least-wrong way to do things.
Note: See TracChangeset for help on using the changeset viewer.