From e48f1b77ea08171199b677599265459f65d0892a Mon Sep 17 00:00:00 2001 From: Stephen Sun Date: Sat, 2 Nov 2024 11:14:04 +0000 Subject: [PATCH] Extra delay between running firmware and updating firmware version Signed-off-by: Stephen Sun --- sfputil/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sfputil/main.py b/sfputil/main.py index 58c6855abe..d8b1c15e1c 100644 --- a/sfputil/main.py +++ b/sfputil/main.py @@ -1591,6 +1591,7 @@ def download_firmware(port_name, filepath): 1 = Hitless Reset to Inactive Image (Default)\n \ 2 = Attempt non-hitless Reset to Running Image\n \ 3 = Attempt Hitless Reset to Running Image\n") +@click.option('--delay', metavar='', type=click.IntRange(0, 10), help="Delay time before updating firmware information to STATE_DB") def run(port_name, mode): """Run the firmware with default mode=0""" @@ -1607,6 +1608,9 @@ def run(port_name, mode): click.echo('Failed to run firmware in mode={}! CDB status: {}'.format(mode, status)) sys.exit(EXIT_FAIL) + if delay: + time.sleep(delay) + update_firmware_info_to_state_db(port_name) click.echo("Firmware run in mode={} success".format(mode))