pvesr status: handle disabled jobs

As the nodes replication status call also returns disabled jobs now,
we need to handle them here too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2017-06-29 11:35:02 +02:00 committed by Dietmar Maurer
parent 3b0ab40a2a
commit 0cfec28cd8

View File

@ -341,9 +341,9 @@ my $print_job_list = sub {
my $print_job_status = sub {
my ($list) = @_;
my $format = "%-20s %-20s %20s %20s %10s %10s %s\n";
my $format = "%-10s %-10s %-20s %20s %20s %10s %10s %s\n";
printf($format, "JobID", "Target", "LastSync", "NextSync", "Duration", "FailCount", "State");
printf($format, "JobID", "Enabled", "Target", "LastSync", "NextSync", "Duration", "FailCount", "State");
foreach my $job (sort { $a->{guest} <=> $b->{guest} } @$list) {
my $plugin = PVE::ReplicationConfig->lookup($job->{type});
@ -365,8 +365,9 @@ my $print_job_status = sub {
}
my $state = $job->{pid} ? "SYNCING" : $job->{error} // 'OK';
my $enabled = $job->{disable} ? 'No' : 'Yes';
printf($format, $job->{id}, $tid,
printf($format, $job->{id}, $enabled, $tid,
$timestr, $nextstr, $job->{duration} // '-',
$job->{fail_count}, $state);
}