From 06c3dd582569e570538d41bede891bc361715f83 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 28 Jul 2024 02:20:08 -0400 Subject: [PATCH] gandi: Invert condition to improve readability --- ddclient.in | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ddclient.in b/ddclient.in index 9207153..71c4cbb 100755 --- a/ddclient.in +++ b/ddclient.in @@ -6950,13 +6950,7 @@ sub nic_gandi_update { rrset_values => [$ip], }), ); - my $ok = 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 { + if (!header_ok($h, $reply)) { $config{$h}{"status-$ipv"} = "bad"; if (defined($response->{status}) && $response->{status} eq "error") { my @errors; @@ -6967,7 +6961,12 @@ sub nic_gandi_update { } else { 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"); } } }