[barefoot][platform] increase init timeout in eeprom.py (#5006)

Because of platform-specific reasons I have to increase init timeout in (platform-plugin)/eeprom.py
This commit is contained in:
Volodymyr Boiko 2020-07-20 21:11:51 +03:00 committed by GitHub
parent c6027ab46f
commit 52c3a238bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,7 @@ EEPROM_SYMLINK = "/var/run/platform/eeprom/syseeprom"
EEPROM_STATUS = "/var/run/platform/eeprom/status"
class board(eeprom_tlvinfo.TlvInfoDecoder):
RETRIES = 3
RETRIES = 35
def __init__(self, name, path, cpld_root, ro):
@ -101,8 +101,10 @@ class board(eeprom_tlvinfo.TlvInfoDecoder):
super(board, self).__init__(self.eeprom_path, 0, EEPROM_STATUS, True)
for attempt in range(self.RETRIES):
if self.eeprom_init() or (attempt + 1 >= self.RETRIES):
if self.eeprom_init():
break
if attempt + 1 == self.RETRIES:
raise RuntimeError("eeprom.py: Initialization failed")
time.sleep(1)
def thrift_setup(self):