Skip to content

Commit 5db59db

Browse files
author
Carl Chang
authored
Update check_snmp.py
1 parent b708ace commit 5db59db

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

check_snmp.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,14 @@ def get_row_output(col_val_raw: str, col_type: str, col_prefix: str = None, col_
187187

188188
if len(category_result_raw) == 1 and len(category_result_raw[0]) == 1: # there is only one status item without anything else
189189
col = category_result_raw[0][0]
190-
category_output = category_output.format(combined_status=get_row_output(col[0],
191-
col[1],
192-
col[2],
193-
col[3]))
190+
row_output = get_row_output(col[0],
191+
col[1],
192+
col[2],
193+
col[3])
194+
if not args_Brief:
195+
category_output = category_output.format(combined_status=row_output)
196+
else:
197+
category_output = category_output.format(combined_status=status_formatter(category_code, with_color=args_MoreFormat))
194198

195199
else:
196200
for row in category_result_raw: # row is like (('DIMM.Socket.A1', 'text'), ('failed', 'status'))
@@ -203,8 +207,9 @@ def get_row_output(col_val_raw: str, col_type: str, col_prefix: str = None, col_
203207

204208
if not args_Brief:
205209
category_output += list_bullet + oid_separator.join(cols) + '\n'
210+
206211
category_output = category_output.format(combined_status=status_formatter(category_code, with_color=args_MoreFormat))
207-
212+
208213
print(category_output)
209214

210215
if imp: exitCodeImp = update_status_code(exitCodeImp, category_code)

0 commit comments

Comments
 (0)