On Thu, Jan 10, 2019 at 07:16:46PM +0100, Thomas Lamprecht wrote:
> On 1/9/19 2:04 PM, Fabian Grünbichler wrote:
> > otherwise there is no way to find out about (all) active tasks over the
> > API if their UPIDs were not recorded when the initial API calls happened.
> > 
> > Signed-off-by: Fabian Grünbichler <f.gruenbich...@proxmox.com>
> > ---
> > changed from v1:
> > - moved from bool to tri-state as suggested by W.Bumiller
> > - previously called 'task index: optionally include active tasks'
> 
> When starting a backup task and doing:
> 
> # pvenode task list --source active

forgot that we had that ;) I only tested with the API endpoint directly.

> 
> I get:
> > Use of uninitialized value in string ne at 
> > /usr/share/perl5/PVE/CLI/pvenode.pm line 168.
> 
> We access $task->{status} in the CLI output parser, and this is not defined 
> there
> yet for (still) running task. Besides the uninitialized value warning this 
> then shows
> even "ERROR" in the Status column for all running tasks. You may want to 
> adapt the
> output formatter to print RUNNING if no status is defined in this patch? And 
> then
> maybe it's warranted to split the refactor $filter_task out and introduce 
> "source"
> parameter into two patches out, but no strong feelings here..

it might be best to introduce a new return property 'source', and then
set the status to RUNNING or UNKNOWN depending on source (and maybe
print source as well?)

thanks for your review!

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to