Skip to content

Commit 4e08440

Browse files
authored
[Credo][Ycable] improve logging for Server Powered off/Faulty cables (sonic-net#272)
Signed-off-by: vaibhav-dahiya <[email protected]> Signed-off-by: vaibhav-dahiya [email protected] Cable could be powered off during which the i2c to the NIC MCU would not be able to respond with which side is active. For such cases the log needs to be improved. In case the cable is powered correctly but still the cable is not able to get the actve side, that would mean a faulty cable. Added/improved the appropriate logs Description Motivation and Context How Has This Been Tested? Improved logs only Additional Information (Optional)
1 parent b70e759 commit 4e08440

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sonic_y_cable/credo/y_cable_credo.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ def get_read_side(self):
617617
self.log_info("Reading from NIC side")
618618
return YCableBase.TARGET_NIC
619619
else:
620-
self.log_error("Error: unknown status for checking which side regval = {} ".format(result))
620+
self.log_error("Error: Credo Y Cable unable to get the read side, Cable not plugged/Faulty Cable register value = {} ".format(result))
621621

622622
return YCableBase.TARGET_UNKNOWN
623623

@@ -675,7 +675,7 @@ def get_mux_direction(self):
675675
self.log_info("mux pointing to TOR B")
676676
return YCableBase.TARGET_TOR_B
677677

678-
self.log_error("Error: unknown status for mux direction regval = {} ".format(result))
678+
self.log_error("Error: Credo Y Cable unable to check the status mux direction, cable powered off/Faulty Cable register value = {}".format(result))
679679
return YCableBase.TARGET_UNKNOWN
680680

681681
def get_active_linked_tor_side(self):
@@ -736,7 +736,7 @@ def get_active_linked_tor_side(self):
736736
self.log_info("Nothing linked for routing")
737737
return YCableBase.TARGET_NIC
738738

739-
self.log_error("Error: unknown status for active TOR regval = {} ".format(result))
739+
self.log_error("Error: Credo Y Cable unable to get active linked ToR side Cable powered off/Faulty Cable register value = {} ".format(result))
740740
return YCableBase.TARGET_UNKNOWN
741741

742742
def is_link_active(self, target):

0 commit comments

Comments
 (0)