content-dirs check: silently skip paths that cannot be resolved
Since commit 8e623a2930, the inequality
check for content-dirs prints a warning if a content directory path
could not be resolved, i.e., if `abs_path` returns undef. Among other
things, `abs_path` returns undef if the path has an inner (= any but
last) component that does not exist. This can happen for a storage
with content type `iso,vztmpl` and `create-subdirs` set to 0, in case
`template/` does not exist. In this case, the warnings printed by
pvestatd are quite noisy.
As missing content directories are not a problem per se, remove the
warning and just ignore the directory during the inequality check.
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
46b9c1fe31
commit
09f1f847ae
@ -1396,10 +1396,7 @@ sub activate_storage {
|
|||||||
for my $vtype (sort keys $scfg->{content}->%*) {
|
for my $vtype (sort keys $scfg->{content}->%*) {
|
||||||
my $subdir = $class->get_subdir($scfg, $vtype);
|
my $subdir = $class->get_subdir($scfg, $vtype);
|
||||||
my $abs_subdir = abs_path($subdir);
|
my $abs_subdir = abs_path($subdir);
|
||||||
if (!defined($abs_subdir)) {
|
next if !defined($abs_subdir);
|
||||||
warn "could not get absolute path for '$subdir' - $!\n";
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
|
|
||||||
die "storage '$storeid' uses directory $abs_subdir for multiple content types\n"
|
die "storage '$storeid' uses directory $abs_subdir for multiple content types\n"
|
||||||
if defined($abs_subdir) && defined($resolved_subdirs->{$abs_subdir});
|
if defined($abs_subdir) && defined($resolved_subdirs->{$abs_subdir});
|
||||||
|
|||||||
Reference in New Issue
Block a user