From c0f5884b8a02cd59922b58e77659a2de43fceb68 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 14 May 2020 01:06:42 +0800 Subject: [PATCH] [fanshow] Add column drawer name and led status to output of show platform fan (#881) --- scripts/fanshow | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/fanshow b/scripts/fanshow index ea6ff3dbd55a..7e1125938d7b 100644 --- a/scripts/fanshow +++ b/scripts/fanshow @@ -9,13 +9,15 @@ from swsssdk import SonicV2Connector from natsort import natsorted -header = ['FAN', 'Speed', 'Direction', 'Presence', 'Status', 'Timestamp'] +header = ['Drawer', 'LED', 'FAN', 'Speed', 'Direction', 'Presence', 'Status', 'Timestamp'] FAN_TABLE_NAME = 'FAN_INFO' +DRAWER_FIELD_NAME = 'drawer_name' SPEED_FIELD_NAME = 'speed' DIRECTION_FIELD_NAME = 'direction' PRESENCE_FIELD_NAME = 'presence' STATUS_FIELD_NAME = 'status' +LED_STATUS_FIELD_NAME = 'led_status' TIMESTAMP_FIELD_NAME = 'timestamp' @@ -58,7 +60,8 @@ class FanShow(object): else: status = 'N/A' - table.append((name, speed, data_dict[DIRECTION_FIELD_NAME], presence, status, data_dict[TIMESTAMP_FIELD_NAME])) + table.append((data_dict[DRAWER_FIELD_NAME], data_dict[LED_STATUS_FIELD_NAME], name, speed, data_dict[DIRECTION_FIELD_NAME], presence, status, + data_dict[TIMESTAMP_FIELD_NAME])) if table: print(tabulate(table, header, tablefmt='simple', stralign='right'))