Skip to content

Commit

Permalink
Handle NotImplementedError exception while calling get_eeprom_path API
Browse files Browse the repository at this point in the history
  • Loading branch information
mihirpat1 committed Sep 15, 2023
1 parent 0dafb55 commit 2dd5f99
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sonic_platform_base/sonic_xcvr/sfp_optoe_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ def set_lpmode(self, lpmode):
return api.set_lpmode(lpmode) if api is not None else None

def set_optoe_write_max(self, write_max):
sys_path = self.get_eeprom_path()
try:
sys_path = self.get_eeprom_path()
except NotImplementedError:
return
sys_path = sys_path.replace("eeprom", "write_max")
try:
with open(sys_path, mode='w') as f:
Expand Down

0 comments on commit 2dd5f99

Please sign in to comment.