api: import working storage: improve error message

the ui and api talks about 'import working storage' but the error here
still said 'for extraction'. Improve the message by unifiying the
wording and adding the storage name to it too.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2024-11-19 09:39:56 +01:00 committed by Thomas Lamprecht
parent ba6bfffecf
commit 2a7cba6fdc

View File

@ -178,14 +178,15 @@ my $check_storage_access = sub {
? PVE::Storage::storage_config($storecfg, $extraction_storage)
: $scfg;
my $extraction_param = defined($extraction_storage) ? 'import-working-storage' : $ds;
my $extraction_id = $extraction_storage // $storeid;
if (!$extraction_scfg->{content}->{images} || !$extraction_scfg->{path}) {
raise_param_exc({
$extraction_param => "storage selected for extraction does not support"
$extraction_param => "import working storage '$extraction_id' does not support"
." 'images' content type or is not file based.",
});
}
$rpcenv->check($authuser, "/storage/" . ($extraction_storage // $storeid), ['Datastore.AllocateSpace']);
$rpcenv->check($authuser, "/storage/$extraction_id", ['Datastore.AllocateSpace']);
}
}