You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the definition of log in script decode-syseeprom (sonic-net#3383)
#### What I did
If there is something wrong getting eeprom while exectuing script `decode-syseeprom`, it will raise an exception and log the error. There was no definition of `log` in script `decode-syseeprom`, which will raise such error
```
Traceback (most recent call last):
File "/usr/local/bin/decode-syseeprom", line 264, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/bin/decode-syseeprom", line 246, in main
print_serial(use_db)
File "/usr/local/bin/decode-syseeprom", line 171, in print_serial
eeprom = instantiate_eeprom_object()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/decode-syseeprom", line 36, in instantiate_eeprom_object
log.log_error('Failed to obtain EEPROM object due to {}'.format(repr(e)))
^^^
NameError: name 'log' is not defined
```
In this PR, I add the definition of log to avoid such error.
#### How I did it
Add the definition of log.
#### How to verify it
```
admin@vlab-01:~$ sudo decode-syseeprom -s
Failed to read system EEPROM info
```
0 commit comments