From 295b68ca4c6ba1b785d5768e36154f1a52479d03 Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Thu, 27 May 2021 00:13:03 -0400 Subject: [PATCH] Add return codes for FW install to component_base constants (#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. --- sonic_platform_base/component_base.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sonic_platform_base/component_base.py b/sonic_platform_base/component_base.py index 074b81def8a2..c272356c8f3a 100644 --- a/sonic_platform_base/component_base.py +++ b/sonic_platform_base/component_base.py @@ -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): """