[pve-devel] [pbs-devel] [PATCH-SERIES] improve warnings handling in UI and add to PVE

Fabian Ebner f.ebner at proxmox.com
Wed Mar 17 09:33:09 CET 2021


Am 16.03.21 um 15:02 schrieb Dominik Csapak:
> series looks good to me, the only thing that might be not ideal
> is the value.replace('WARNINGS', '') call. it seems very brittle
> though in reality it will probably not be a problem
> 
> Reviewed-By: Dominik Csapak <d.csapak at proxmox.com>
> 

Thanks for the review. I'm also not 100% happy with the replace. I 
didn't see a better alternative at the time, but maybe I do now:

We need to keep backwards compatibility for the existing callers of 
parse_task_status(), so also returning the number of warnings there 
doesn't seem to work. Instead, we could add a new 
parse_task_status_full() that returns both the status *and* the text to 
be displayed.

A better version of the replace would also be possible:
     value.replace('WARNINGS', Proxmox.Utils.warningsText);

If one of those sounds sensible, I'll send a v2.





More information about the pve-devel mailing list