Make use of the newly introduced content type assertion helpers at verifying the added and/or changed container config values, which is called e.g. in the API handler for updating the container config.
Signed-off-by: Daniel Kral <d.k...@proxmox.com> --- changes since v2: * rename helper from *_supported to *_available src/PVE/LXC/Config.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index 0740e8c..cedf061 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -1176,9 +1176,7 @@ sub update_pct_config { my $check_content_type = sub { my ($mp) = @_; my $sid = PVE::Storage::parse_volume_id($mp->{volume}); - my $storage_config = PVE::Storage::storage_config($storage_cfg, $sid); - die "storage '$sid' does not allow content type 'rootdir' (Container)\n" - if !$storage_config->{content}->{rootdir}; + PVE::Storage::assert_content_type_available($storage_cfg, $sid, 'rootdir'); }; foreach my $opt (sort keys %$param) { # add/change -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel