From 904f06a82e48895bbff3bbe25594ab69472ade3d Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Fri, 12 Nov 2021 15:29:42 +0100 Subject: [PATCH] pbs: update attribute: cleaner error message if not supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: Fabian Grünbichler Signed-off-by: Fabian Ebner --- PVE/Storage/PBSPlugin.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PVE/Storage/PBSPlugin.pm b/PVE/Storage/PBSPlugin.pm index 06ebfa7..e186663 100644 --- a/PVE/Storage/PBSPlugin.pm +++ b/PVE/Storage/PBSPlugin.pm @@ -881,7 +881,12 @@ sub update_volume_attribute { my $conn = pbs_api_connect($scfg, $password); my $datastore = $scfg->{datastore}; - $conn->put("/api2/json/admin/datastore/$datastore/$attribute", $param); + eval { $conn->put("/api2/json/admin/datastore/$datastore/$attribute", $param); }; + if (my $err = $@) { + die "Server is not recent enough to support feature '$attribute'\n" + if $err->{code} == 404; + die $err; + } return; }