[pve-devel] [PATCH manager] pvesr status: handle disabled jobs
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Jun 29 11:35:02 CEST 2017
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 at proxmox.com>
---
PVE/CLI/pvesr.pm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/PVE/CLI/pvesr.pm b/PVE/CLI/pvesr.pm
index f5d4db5b..16989308 100644
--- a/PVE/CLI/pvesr.pm
+++ b/PVE/CLI/pvesr.pm
@@ -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);
}
--
2.11.0
More information about the pve-devel
mailing list