Merge pull request #488 from ThinkChaos/fix/ovh-multiline-response

This commit is contained in:
Sandro 2023-01-13 18:51:16 +01:00 committed by GitHub
commit 63a78a7f46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6946,8 +6946,8 @@ sub nic_ovh_update {
}
my @reply = split /\n/, $reply;
my $returned = pop(@reply);
if ($returned =~ /good/ || $returned =~ /nochg/) {
my $returned = List::Util::first { $_ =~ /good/ || $_ =~ /nochg/ } @reply;
if ($returned) {
$config{$h}{'ip'} = $ip;
$config{$h}{'mtime'} = $now;
$config{$h}{'status'} = 'good';
@ -6958,7 +6958,7 @@ sub nic_ovh_update {
}
} else {
$config{$h}{'status'} = 'failed';
failed("updating %s: Server said: '%s'", $h, $returned);
failed("updating %s: Server said: '%s'", $h, $reply);
}
}
}