* [pve-devel] [PATCH storage] content-dirs check: silently skip paths that cannot be resolved
@ 2023-06-15 11:36 Friedrich Weber
2023-06-15 12:19 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Friedrich Weber @ 2023-06-15 11:36 UTC (permalink / raw)
To: pve-devel
Since commit 8e623a2930f7aee4b3309b1f297613a250ee4698, 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>
---
src/PVE/Storage/Plugin.pm | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
index ab6b675..3f9f1ec 100644
--- a/src/PVE/Storage/Plugin.pm
+++ b/src/PVE/Storage/Plugin.pm
@@ -1396,10 +1396,7 @@ sub activate_storage {
for my $vtype (sort keys $scfg->{content}->%*) {
my $subdir = $class->get_subdir($scfg, $vtype);
my $abs_subdir = abs_path($subdir);
- if (!defined($abs_subdir)) {
- warn "could not get absolute path for '$subdir' - $!\n";
- next;
- }
+ next if !defined($abs_subdir);
die "storage '$storeid' uses directory $abs_subdir for multiple content types\n"
if defined($abs_subdir) && defined($resolved_subdirs->{$abs_subdir});
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH storage] content-dirs check: silently skip paths that cannot be resolved
2023-06-15 11:36 [pve-devel] [PATCH storage] content-dirs check: silently skip paths that cannot be resolved Friedrich Weber
@ 2023-06-15 12:19 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-06-15 12:19 UTC (permalink / raw)
To: Proxmox VE development discussion, Friedrich Weber
Am 15/06/2023 um 13:36 schrieb Friedrich Weber:
> Since commit 8e623a2930f7aee4b3309b1f297613a250ee4698, 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>
> ---
> src/PVE/Storage/Plugin.pm | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-15 12:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 11:36 [pve-devel] [PATCH storage] content-dirs check: silently skip paths that cannot be resolved Friedrich Weber
2023-06-15 12:19 ` [pve-devel] applied: " Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal