[pve-devel] [PATCH manager] fix #3961: pveam: error if storage doesn't exist on 'list'

Fabian Ebner f.ebner at proxmox.com
Fri Jun 10 09:36:42 CEST 2022


Am 28.03.22 um 11:53 schrieb Oguz Bektas:
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
>  PVE/CLI/pveam.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/PVE/CLI/pveam.pm b/PVE/CLI/pveam.pm
> index 6c26f209..0ad33823 100644
> --- a/PVE/CLI/pveam.pm
> +++ b/PVE/CLI/pveam.pm
> @@ -122,6 +122,8 @@ __PACKAGE__->register_method ({
>  
>  	my $cfg = PVE::Storage::config();
>  
> +	die "Storage does not exist!\n" if !defined($cfg->{ids}->{$storeid});

Using PVE::Storage::storage_check_enabled() would additionally catch
disabled storages and existing storages that are not available on the
current node.

> +
>  	die "Storage does not support templates!\n" if !$cfg->{ids}->{$storeid}->{content}->{vztmpl};
>  
>  	my $vollist = PVE::Storage::volume_list($cfg, $storeid, undef, 'vztmpl');





More information about the pve-devel mailing list