Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Move --ns & --ds validation earlier in the code

Co-authored-by: tgreenx <96772376+tgreenx@users.noreply.github.com>
  • Loading branch information
MichaelTimbert and tgreenx committed Aug 28, 2024
1 parent faf2d5d commit c403be5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/Zonemaster/CLI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,14 @@ sub run {

( my $errors, $domain ) = normalize_name( decode( 'utf8', $domain ) );

if ( $self->ns and @{ $self->ns } > 0 ) {
$self->check_fake_delegation( $domain );
}

if ( $self->ds and @{ $self->ds } ) {
$self->check_fake_ds( $domain );
}

if ( scalar @$errors > 0 ) {
my $error_message;
foreach my $err ( @$errors ) {
Expand All @@ -640,14 +648,6 @@ sub run {
Zonemaster::Engine::Recursor->add_fake_addresses( '.', $hints_data );
}

if ( $self->ns and @{ $self->ns } > 0 ) {
$self->check_fake_delegation( $domain );
}

if ( $self->ds and @{ $self->ds } ) {
$self->check_fake_ds( $domain );
}

if ( $self->profile or $self->test ) {
# Separate initialization from main output in human readable output mode
print "\n" if $fh_diag eq *STDOUT;
Expand Down

0 comments on commit c403be5

Please sign in to comment.