Skip to content

Commit

Permalink
Add return codes for FW install to component_base constants (#189)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexrallen authored May 27, 2021
1 parent e8e617d commit 295b68c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sonic_platform_base/component_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
to interact with a chassis/module component (e.g., BIOS, CPLD, FPGA, etc.) in SONiC
"""

# Return codes for firmware updates

FW_AUTO_INSTALLED = 1
FW_AUTO_UPDATED = 2
FW_AUTO_SCHEDULED = 3
FW_AUTO_ERR_BOOT_TYPE = -1
FW_AUTO_ERR_IMAGE = -2
FW_AUTO_ERR_UKNOWN = -3


class ComponentBase(object):
"""
Expand Down

0 comments on commit 295b68c

Please sign in to comment.