Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/perldeps.pl
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
{cpan=>'Text::ParseWords', apt=>'', rpm=>''},
{cpan=>'Carp::Assert', apt=>'libcarp-assert-perl', rpm=>'perl-Carp-Assert'},
{cpan=>'Digest::SHA', apt=> 'libdigest-sha-perl', rpm=>'perl-Digest-SHA1'},
{apt=> 'libssl-dev', rpm=>'openssl-devel'}, # needed by Net::DNS::ZoneFile::Fast
{cpan=>'Net::DNS::ZoneFile::Fast', apt=> 'dnssec-tools', rpm=>''},
{apt=> 'libssl-dev', rpm=>'openssl-devel'}, # needed by Net::DNS::ZoneFile
{cpan=>'Net::DNS::ZoneFile', apt=> 'libnet-dns-perl', rpm=>'perl-Net-DNS'},
{cpan=>'Socket6', apt=> 'libsocket6-perl', rpm=>'perl-Socket6'},
{cpan=>'XML::Simple', apt=>'libxml-simple-perl', rpm=>'perl-XML-Simple'},
{apt=>'snmp'},
Expand Down
9 changes: 5 additions & 4 deletions import/import_bind_zones.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
use lib "<<Make:LIB>>";
use Netdot::Model;
use Net::DNS::ZoneFile::Fast;
use Net::DNS::ZoneFile;
use Getopt::Long qw(:config no_ignore_case bundling);
use BIND::Config::Parser;
use strict;
Expand Down Expand Up @@ -146,11 +146,12 @@ sub import_zone {
(-e $file && -f $file) || die "File $file does not exist or is not a regular file\n";
print "Importing zone file: $file\n";

my $rrs = Net::DNS::ZoneFile::Fast::parse(file=>"$file",origin=>$domain);
my $zonefile = new Net::DNS::ZoneFile($file, $domain);
my @rrs = $zonefile->read;

my $nzone;

foreach my $rr ( @$rrs ){
foreach my $rr ( @rrs ){
if ( $rr->type eq 'SOA' ){
my $name = $rr->name;
$name =~ s/\.$//;
Expand Down Expand Up @@ -181,7 +182,7 @@ sub import_zone {
}
}

$nzone->import_records(rrs => $rrs,
$nzone->import_records(rrs => \@rrs,
update_ptrs => $self{update_ptrs},
);
}
6 changes: 3 additions & 3 deletions lib/Netdot/Model/Zone.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Netdot::Model::Zone;
use base 'Netdot::Model';
use warnings;
use strict;
use Net::DNS::ZoneFile::Fast;
use Net::DNS::ZoneFile;

my $logger = Netdot->log->get_logger('Netdot::Model::DNS');

Expand Down Expand Up @@ -651,9 +651,9 @@ sub import_records {

if ( $argv{text } ){
eval {
my $zone_content = $argv{text};
my $zone_content = '$ORIGIN ' . $domain. "\n" . $argv{text};
$zone_content =~ s/\r\n/\n/g;
$rrs = Net::DNS::ZoneFile::Fast::parse(text=>$zone_content, origin=>$domain);
$rrs = Net::DNS::ZoneFile->parse( $zone_content );
};
if ( my $e = $@ ){
$self->throw_user("Error parsing Zone data: $e")
Expand Down