Skip to content

Commit

Permalink
[decode-syseeprom] fix getattribute check for sime platforms (#835)
Browse files Browse the repository at this point in the history
For some platforms which implement the eeprom plugin by inheriting from TlvInfoDecoder, the line

t.getattr('read_eeprom_db', None) == None:
results in an error:
AttributeError: 'board' object has no attribute 'getattr'

The cause for that is that TlvInfoDecoder inherits from object, and looks like for object and derived classes there is no __getattr__.

Signed-off-by: Mykola Faryma <[email protected]>
  • Loading branch information
mykolaf authored Mar 22, 2020
1 parent db78cb6 commit 727b499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/decode-syseeprom
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def main():
# Currently, don't support eeprom db on Arista platform
platforms_without_eeprom_db = ['arista', 'kvm']
if any(platform in platform_path for platform in platforms_without_eeprom_db)\
or t.getattr('read_eeprom_db', None) == None:
or getattr(t, 'read_eeprom_db', None) == None:
support_eeprom_db = False

#
Expand Down

0 comments on commit 727b499

Please sign in to comment.