gandi: Invert condition to improve readability

This commit is contained in:
Richard Hansen 2024-07-28 02:20:08 -04:00
parent 6f505e6538
commit 06c3dd5825

View file

@ -6950,13 +6950,7 @@ sub nic_gandi_update {
rrset_values => [$ip], rrset_values => [$ip],
}), }),
); );
my $ok = header_ok($h, $reply); if (!header_ok($h, $reply)) {
if ($ok) {
$config{$h}{'ip'} = $ip;
$config{$h}{'mtime'} = $now;
$config{$h}{"status-$ipv"} = "good";
success("$h: updated successfully to $ip");
} else {
$config{$h}{"status-$ipv"} = "bad"; $config{$h}{"status-$ipv"} = "bad";
if (defined($response->{status}) && $response->{status} eq "error") { if (defined($response->{status}) && $response->{status} eq "error") {
my @errors; my @errors;
@ -6967,7 +6961,12 @@ sub nic_gandi_update {
} else { } else {
failed("$h: unexpected service response"); failed("$h: unexpected service response");
} }
next;
} }
$config{$h}{'ip'} = $ip;
$config{$h}{'mtime'} = $now;
$config{$h}{"status-$ipv"} = "good";
success("$h: updated successfully to $ip");
} }
} }
} }