]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/PBSPlugin.pm
pbs: update attribute: cleaner error message if not supported
[pve-storage.git] / PVE / Storage / PBSPlugin.pm
index 06ebfa76f6b6adec1dfe45731368a3d5fab86254..e186663316d361753768cd973b793a988c77f3cb 100644 (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;
     }