Skip to content

Commit

Permalink
[Credo][Ycable] Fix Credo firmware download API download_firmware flag (
Browse files Browse the repository at this point in the history
#269)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>

Due to PR #222
the download_firmware_status variable of download_firmware API was not cleaned up, due to which higher layer
could sometimes see wrong values of firmware version.
This PR addresses this issue.

After calling a firmware download and not changing this variable


admin@sonic:~$ show mux firmware version Ethernet0
{
    "version_nic_active": "N/A",
    "version_nic_inactive": "N/A",
    "version_nic_next": "N/A",
    "version_peer_active": "N/A",
    "version_peer_inactive": "N/A",
    "version_peer_next": "N/A",
    "version_self_active": "N/A",
    "version_self_inactive": "N/A",
    "version_self_next": "N/A"
}
after the change

admin@sonic:~$ show mux firmware version Ethernet0
<versionX>
{
    "version_nic_active": "1.0MS",
    "version_nic_inactive": "1.1MS",
    "version_nic_next": "1.0MS",
    "version_peer_active": "1.0MS",
    "version_peer_inactive": "1.1MS",
    "version_peer_next": "1.0MS",
    "version_self_active": "1.0MS",
    "version_self_inactive": "1.1MS",
    "version_self_next": "1.0MS"
}
Description
Motivation and Context
How Has This Been Tested?
Tested on an Arista Device.
  • Loading branch information
vdahiya12 authored Mar 16, 2022
1 parent a844f18 commit 573717a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sonic_y_cable/credo/y_cable_credo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,8 @@ def download_firmware(self, fwfile):
self.log_error("platform_chassis is not loaded, failed to download firmware")
return YCable.EEPROM_ERROR

self.download_firmware_status = self.FIRMWARE_DOWNLOAD_STATUS_NOT_INITIATED_OR_FINISHED

return YCableBase.FIRMWARE_DOWNLOAD_SUCCESS

def activate_firmware(self, fwfile=None, hitless=False):
Expand Down

0 comments on commit 573717a

Please sign in to comment.