pbs: update attribute: cleaner error message if not supported

Reported-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner
2021-11-12 15:29:42 +01:00
committed by Thomas Lamprecht
parent c7aa1e28dd
commit 904f06a82e

View File

@ -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;
}