[Firmware ] Run SONIC command#1793
[Firmware ] Run SONIC command#1793KostiantynYarovyiBf wants to merge 1 commit intosonic-net:masterfrom
Conversation
fwutil/main.py
Outdated
There was a problem hiding this comment.
To simplify dependencies management imports should be grouped in next order:
1. Standard library imports.
2. Related third party imports.
3. Local application/library specific imports.
There was a problem hiding this comment.
Interesting from https://www.python.org/dev/peps/pep-0008/#imports
# Correct:
import os
import sys
# Wrong:
import sys, os
Is it affect logic of work or its just a recommendation for style of code?
fwutil/main.py
Outdated
There was a problem hiding this comment.
the expression can be simplified, to not duplicate code and simplify adding new entries:
platforms = {
"x86_64-accton_as9516bf_32d-r0",
"x86_64-accton_as9516_32d-r0",
"x86_64-accton_wedge100bf_32x-r0",
"x86_64-accton_wedge100bf_65x-r0",
}
if device_info.get_platform() in platforms :
...
There was a problem hiding this comment.
What if a new barefoot platform will be added?
Please use get_platform_info and check by asic_type filed. https://github.com/msosyak/sonic-buildimage/blob/2e7e7814cc71c353bef179c7f29bf00fcbac8714/src/sonic-py-common/sonic_py_common/device_info.py#L327
fwutil/main.py
Outdated
There was a problem hiding this comment.
| raise NameError("Firmware updates are not supported for barefoot") | |
| raise NameError("Firmware updates are not supported by barefoot devices") |
f323572 to
2f1eac5
Compare
What I did
add log Not supported firmware updates if platform is barefoot
How I did it
add raise exception if platform is barefoot
How to verify it
Run show platform firmware updates
|
@jleveque please review |
|
close this PR because add correct fix with another PR |
What I did
add log Not supported firmware updates if platform is barefoot
How I did it
add raise exception if platform is barefoot
How to verify it
Run show platform firmware updates
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)