]> git.proxmox.com Git - pve-storage.git/commitdiff
dir plugin: get notes: return undef if notes are not supported
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 30 Sep 2021 11:42:05 +0000 (13:42 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 8 Nov 2021 13:56:15 +0000 (14:56 +0100)
This avoids showing empty notes in the result of the content/{volid}
API call for volumes that do not even support notes. It's also in
preparation for the proposed get_volume_attribute generalization,
which expects undef to be returned when an attribute is not supported.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Storage/DirPlugin.pm

index 1fcb8ce0b6167c806eba38adca2a7fe4a68c0d61..2aacb35937ae164d7421dca95cb3a9a0c71bcc74 100644 (file)
@@ -94,6 +94,9 @@ sub parse_is_mountpoint {
 sub get_volume_notes {
     my ($class, $scfg, $storeid, $volname, $timeout) = @_;
 
+    my ($vtype) = $class->parse_volname($volname);
+    return if $vtype ne 'backup';
+
     my $path = $class->filesystem_path($scfg, $volname);
     $path .= $class->SUPER::NOTES_EXT;