Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra delay between running firmware and updating firmware version #3610

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sfputil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='<delay>', type=click.IntRange(0, 10), help="Delay time before updating firmware information to STATE_DB")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prgeor Should we have a default delay of 5s for all modules?

def run(port_name, mode):
"""Run the firmware with default mode=0"""

Expand All @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephenxs Can you put a comment why this delay is required?

time.sleep(delay)

update_firmware_info_to_state_db(port_name)
click.echo("Firmware run in mode={} success".format(mode))

Expand Down
Loading