Skip to content

Commit

Permalink
[Credo][Ycable] improve logging for Server Powered off/Faulty cables (#…
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
vdahiya12 authored Apr 14, 2022
1 parent b70e759 commit 4e08440
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sonic_y_cable/credo/y_cable_credo.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def get_read_side(self):
self.log_info("Reading from NIC side")
return YCableBase.TARGET_NIC
else:
self.log_error("Error: unknown status for checking which side regval = {} ".format(result))
self.log_error("Error: Credo Y Cable unable to get the read side, Cable not plugged/Faulty Cable register value = {} ".format(result))

return YCableBase.TARGET_UNKNOWN

Expand Down Expand Up @@ -675,7 +675,7 @@ def get_mux_direction(self):
self.log_info("mux pointing to TOR B")
return YCableBase.TARGET_TOR_B

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

def get_active_linked_tor_side(self):
Expand Down Expand Up @@ -736,7 +736,7 @@ def get_active_linked_tor_side(self):
self.log_info("Nothing linked for routing")
return YCableBase.TARGET_NIC

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

def is_link_active(self, target):
Expand Down

0 comments on commit 4e08440

Please sign in to comment.