This commit is contained in:
Justin Thomas 2024-03-25 21:09:02 +00:00 committed by GitHub
commit b15d9b96a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,10 +25,12 @@ class Eeprom(eeprom_tlvinfo.TlvInfoDecoder):
self.eeprom_path = f
super(Eeprom, self).__init__(self.eeprom_path, 0, '', True)
self.eeprom_tlv_dict = dict()
self.eeprom_data = "N/A"
if os.geteuid() == 0:
try:
self.eeprom_data = self.read_eeprom()
except Exception:
self.eeprom_data = "N/A"
raise RuntimeError("Eeprom is not Programmed")
eeprom = self.eeprom_data
@ -48,7 +50,6 @@ class Eeprom(eeprom_tlvinfo.TlvInfoDecoder):
+ (eeprom[tlv_index + 1])]
code = "0x%02X" % ((tlv[0]))
name, value = self.decoder(None, tlv)
self.eeprom_tlv_dict[code] = value