From adb547f0974798c8a95018d8d38598b7b791e3c0 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 21 Sep 2016 16:45:20 +0200 Subject: [PATCH] Fix status alignment output reported by Wanderlei Huttel --- bacula/src/dird/ua_status.c | 4 ++-- bacula/src/lib/status.h | 9 +++++---- regress/tests/short-incremental-test | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index c0faaa880e..52d25c34b6 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -1090,7 +1090,7 @@ static void list_terminated_jobs(UAContext *ua) struct s_last_job *je; if (!ua->api) { ua->send_msg(_("\nTerminated Jobs:\n")); - ua->send_msg(_(" JobId Level Files Bytes Status Finished Name \n")); + ua->send_msg(_(" JobId Level Files Bytes Status Finished Name \n")); ua->send_msg(_("====================================================================\n")); } foreach_dlist(je, last_jobs) { @@ -1159,7 +1159,7 @@ static void list_terminated_jobs(UAContext *ua) termstat, dt, JobName); } else { - ua->send_msg(_("%6d %-6s %8s %10s %-7s %-8s %s\n"), + ua->send_msg(_("%6d %-7s %8s %10s %-7s %-8s %s\n"), je->JobId, level, edit_uint64_with_commas(je->JobFiles, b1), diff --git a/bacula/src/lib/status.h b/bacula/src/lib/status.h index 59271f7f87..d38bf4334e 100644 --- a/bacula/src/lib/status.h +++ b/bacula/src/lib/status.h @@ -81,7 +81,7 @@ static void list_terminated_jobs(STATUS_PKT *sp) return; } lock_last_jobs_list(); - msg = _(" JobId Level Files Bytes Status Finished Name \n"); + msg = _(" JobId Level Files Bytes Status Finished Name \n"); if (!sp->api) sendit(msg, strlen(msg), sp); msg = _("===================================================================\n"); if (!sp->api) sendit(msg, strlen(msg), sp); @@ -93,8 +93,9 @@ static void list_terminated_jobs(STATUS_PKT *sp) bstrftime_nc(dt, sizeof(dt), je->end_time); switch (je->JobType) { case JT_ADMIN: + bstrncpy(level, "Admin", sizeof(level)); case JT_RESTORE: - bstrncpy(level, " ", sizeof(level)); + bstrncpy(level, "Restore", sizeof(level)); break; default: bstrncpy(level, job_level_to_str(je->JobLevel), sizeof(level)); @@ -137,7 +138,7 @@ static void list_terminated_jobs(STATUS_PKT *sp) } } if (sp->api == 1) { - bsnprintf(buf, sizeof(buf), _("%6d\t%-6s\t%8s\t%10s\t%-7s\t%-8s\t%s\n"), + bsnprintf(buf, sizeof(buf), _("%6d\t%-7s\t%8s\t%10s\t%-7s\t%-8s\t%s\n"), je->JobId, level, edit_uint64_with_commas(je->JobFiles, b1), @@ -145,7 +146,7 @@ static void list_terminated_jobs(STATUS_PKT *sp) termstat, dt, JobName); } else { - bsnprintf(buf, sizeof(buf), _("%6d %-6s %8s %10s %-7s %-8s %s\n"), + bsnprintf(buf, sizeof(buf), _("%6d %-7s %8s %10s %-7s %-8s %s\n"), je->JobId, level, edit_uint64_with_commas(je->JobFiles, b1), diff --git a/regress/tests/short-incremental-test b/regress/tests/short-incremental-test index 7556e4a0e6..a6596dbee2 100755 --- a/regress/tests/short-incremental-test +++ b/regress/tests/short-incremental-test @@ -82,6 +82,7 @@ setdebug level=10 storage=File restore where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list yes wait +status dir status client status storage=File messages -- 2.39.5