Fix undef warning when encountering an unset but required var
This fixes a bug probably introduced in commit
b8a0a26441
This commit is contained in:
parent
89c84f9f07
commit
f5b369a7ef
1 changed files with 2 additions and 1 deletions
|
@ -2046,7 +2046,8 @@ sub init_config {
|
||||||
my $ovalue = $config{$h}{$k} // $def->{'default'};
|
my $ovalue = $config{$h}{$k} // $def->{'default'};
|
||||||
my $value = check_value($ovalue, $def);
|
my $value = check_value($ovalue, $def);
|
||||||
if ($def->{'required'} && !defined $value) {
|
if ($def->{'required'} && !defined $value) {
|
||||||
warning("skipping host: %s: '%s=%s' is an invalid %s.", $h, $k, $ovalue, $def->{'type'});
|
$ovalue //= '(not set)';
|
||||||
|
warning("skipping host $h: invalid $def->{type} variable value '$k=$ovalue'");
|
||||||
delete $config{$h};
|
delete $config{$h};
|
||||||
next HOST;
|
next HOST;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue