Skip to content

Commit 295b68c

Browse files
authored
Add return codes for FW install to component_base constants (sonic-net#189)
Description Added constants to component_base for each potential return code of auto_firmware_update() so that vendor specific component implementations may reference these to provide the correct return codes to the firmware auto update utility. Motivation and Context This provides a central location from which standardized return codes may be imported, preventing the need for potential inconsistency in vendor implementations or the use of magic numbers in vendor implementations for return code. How Has This Been Tested? Non-functional change, builds successfully and can be successfully imported from at runtime.
1 parent e8e617d commit 295b68c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sonic_platform_base/component_base.py

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
to interact with a chassis/module component (e.g., BIOS, CPLD, FPGA, etc.) in SONiC
66
"""
77

8+
# Return codes for firmware updates
9+
10+
FW_AUTO_INSTALLED = 1
11+
FW_AUTO_UPDATED = 2
12+
FW_AUTO_SCHEDULED = 3
13+
FW_AUTO_ERR_BOOT_TYPE = -1
14+
FW_AUTO_ERR_IMAGE = -2
15+
FW_AUTO_ERR_UKNOWN = -3
16+
817

918
class ComponentBase(object):
1019
"""

0 commit comments

Comments
 (0)