Truncating the Reasons column in CLI output if it is too long

Resolves: rhbz#2217999

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I29aa2e42ebe6df62ff69db2242a27a6096ee2fc4
This commit is contained in:
Jiri Podivin 2023-06-28 13:45:00 +02:00
parent 70c3ac1d14
commit 7083d2ab4c

View File

@ -78,6 +78,8 @@ def print_dict(data):
if row.get('Status'):
status = row.get('Status')
row['Status'] = colors.color_output(status, status=status)
if row.get('Reasons') and len(row['Reasons']) > 80:
row['Reasons'] = row['Reasons'][:80] + '...(output truncated, see logs for full output)'
table.add_row(row.values())
print(table)