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:
committed by
Thomas Lamprecht
parent
c7aa1e28dd
commit
904f06a82e
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user