check_storage_availability: make content type check generic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-06-23 12:03:35 +02:00
parent 354e61aacc
commit 3148f0b053

View File

@ -2466,8 +2466,10 @@ sub check_storage_availability {
my $scfg = PVE::Storage::storage_check_enabled($storecfg, $sid); my $scfg = PVE::Storage::storage_check_enabled($storecfg, $sid);
PVE::Storage::storage_check_enabled($storecfg, $sid, $node); PVE::Storage::storage_check_enabled($storecfg, $sid, $node);
die "content type 'images' is not available on storage '$sid'\n" my ($vtype) = PVE::Storage::parse_volname($storecfg, $volid);
if !$scfg->{content}->{images};
die "$volid: content type '$vtype' is not available on storage '$sid'\n"
if !$scfg->{content}->{$vtype};
}); });
} }