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))