dslreports1: Log message improvements

This commit is contained in:
Richard Hansen 2024-07-26 19:55:02 -04:00
parent 2d60183e93
commit 95a10e2595

View file

@ -4243,8 +4243,7 @@ sub nic_dslreports1_update {
## update each configured host ## update each configured host
for my $h (@_) { for my $h (@_) {
my $ip = delete $config{$h}{'wantip'}; my $ip = delete $config{$h}{'wantip'};
info("setting IP address to %s for %s", $ip, $h); info("$h: setting IP address to $ip");
verbose("UPDATE:", "updating %s", $h);
my $url; my $url;
$url = "https://$config{$h}{'server'}/nic/"; $url = "https://$config{$h}{'server'}/nic/";
@ -4260,7 +4259,7 @@ sub nic_dslreports1_update {
password => $config{$h}{'password'}, password => $config{$h}{'password'},
) // ''; ) // '';
if ($reply eq '') { if ($reply eq '') {
failed("updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); failed("$h: request to $config{$h}{'server'} failed");
next; next;
} }
@ -4272,15 +4271,13 @@ sub nic_dslreports1_update {
if ($return_code !~ /NOERROR/) { if ($return_code !~ /NOERROR/) {
$config{$h}{'status'} = 'failed'; $config{$h}{'status'} = 'failed';
warning("SENT: %s", $url) unless opt('verbose'); failed("$h: $reply");
warning("REPLIED: %s", $reply);
failed("updating %s", $h);
} else { } else {
$config{$h}{'ip'} = $ip; $config{$h}{'ip'} = $ip;
$config{$h}{'mtime'} = $now; $config{$h}{'mtime'} = $now;
$config{$h}{'status'} = 'good'; $config{$h}{'status'} = 'good';
success("updating %s: %s: IP address set to %s", $h, $return_code, $ip); success("$h: $return_code: IP address set to $ip");
} }
} }
} }