Changeset 380


Ignore:
Timestamp:
08/10/12 16:06:31 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix minor(ish) bug in import of locations; set default_location
on new zones. See #10.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tiny-import.pl

    r375 r380  
    409409      if ($zone =~ /\.arpa$/) {
    410410        ($code,$msg) = DNSDB::_zone2cidr($zone);
    411         $dbh->do("INSERT INTO revzones (revnet,group_id,status) VALUES (?,1,1)", undef, ($msg));
     411        $dbh->do("INSERT INTO revzones (revnet,group_id,status,default_location) VALUES (?,1,1,?)",
     412                undef, ($msg, $loc));
    412413        my ($rdns) = $dbh->selectrow_array("SELECT currval('revzones_rdns_id_seq')");
    413414        $recsth->execute(0, $rdns, "$contact:$master", 6, "$refresh:$retry:$expire:$minttl", 0, 0, 0, $ttl, $loc);
    414415      } else {
    415         $dbh->do("INSERT INTO domains (domain,group_id,status) VALUES (?,1,1)", undef, ($zone));
     416        $dbh->do("INSERT INTO domains (domain,group_id,status,default_location) VALUES (?,1,1,?)",
     417                undef, ($zone, $loc));
    416418        my ($domid) = $dbh->selectrow_array("SELECT currval('domains_domain_id_seq')");
    417419        $recsth->execute($domid, 0, "$contact:$master", 6, "$refresh:$retry:$expire:$minttl", 0, 0, 0, $ttl, $loc);
     
    489491        if (!$rdns) {
    490492          $errstr = "adding revzone $msg";
    491           $dbh->do("INSERT INTO revzones (revnet,group_id,status) VALUES (?,1,1)", undef, ($msg));
     493          $dbh->do("INSERT INTO revzones (revnet,group_id,status,default_location) VALUES (?,1,1,?)",
     494                undef, ($msg, $loc));
    492495          ($rdns) = $dbh->selectrow_array("SELECT currval('revzones_rdns_id_seq')");
    493496# this would probably make a lot more sense to do hostmaster.$config{admindomain}
     
    508511        if (!$domid) {
    509512          $errstr = "adding domain $fqdn";
    510           $dbh->do("INSERT INTO domains (domain,group_id,status) VALUES (?,1,1)", undef, ($fqdn));
     513          $dbh->do("INSERT INTO domains (domain,group_id,status,default_location) VALUES (?,1,1,?)",
     514                undef, ($fqdn, $loc));
    511515          ($domid) = $dbh->selectrow_array("SELECT currval('domains_domain_id_seq')");
    512516          $recsth->execute($domid, 0, "hostmaster.$fqdn:$ns", 6, "16384:2048:1048576:2560", 0, 0, 0, "2560", $loc);
Note: See TracChangeset for help on using the changeset viewer.