From 2a7cba6fdc6e58d51f45969bddecc2ab3d5f1087 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 19 Nov 2024 09:39:56 +0100 Subject: [PATCH] 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 --- PVE/API2/Qemu.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 01ad167a..53ff7092 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -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']); } }