mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-15 13:20:59 +00:00
PVE/JSONSchema: add pve-task-status-type
to have a format that contains the possible worker task states Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
13c771819a
commit
f43ace29ca
@ -689,6 +689,18 @@ sub pve_verify_tfa_secret {
|
|||||||
die "unable to decode TFA secret\n";
|
die "unable to decode TFA secret\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PVE::JSONSchema::register_format('pve-task-status-type', \&verify_task_status_type);
|
||||||
|
sub verify_task_status_type {
|
||||||
|
my ($value, $noerr) = @_;
|
||||||
|
|
||||||
|
return $value if $value =~ m/^(ok|error|warning|unknown)$/i;
|
||||||
|
|
||||||
|
return undef if $noerr;
|
||||||
|
|
||||||
|
die "invalid status '$value'\n";
|
||||||
|
}
|
||||||
|
|
||||||
sub check_format {
|
sub check_format {
|
||||||
my ($format, $value, $path) = @_;
|
my ($format, $value, $path) = @_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user