sonic-utilities
sonic-utilities copied to clipboard
fanshow: Keep some backward compatibility before FanDrawer introduction
The new FanDrawer API is meant to supersede the direct Fan declaration
in the platform API.
However, some vendors might have not yet implemented it.
For those, the show platform fan cli got broken when the DRAWER_NAME
column was added to the output.
To preserve some backward compatibility with the platform API before the
introduction of the FanDrawer, if the DRAWER_NAME is not defined in the
database, Unknown will be displayed.
This simple change avoids breaking show platform fans
Reformat the tuple vertically to avoid a long line and improve clarity.
This commit is quite significant. Even if 'FanDrawer' is proposed, the 'Chassis Fan' and 'PSU Fan' still won't have the 'drawer_name' attribute. Would using 'N/A' be better than 'Unknown' in this case?