-
Notifications
You must be signed in to change notification settings - Fork 672
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
Allow fw update for other boot type against on the previous "none" boot fw update #2040
Conversation
@alexrallen @nazariig Can you please help review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes! All looks good to me except one question I would like you to take a look at.
fwutil/lib.py
Outdated
data = self.read_au_status_file_if_exists(FW_AU_STATUS_FILE_PATH) | ||
if data is not None: | ||
boot_type = list(data.keys())[0] | ||
if boot_type is "none" and boot_type is not boot: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why boot_type is not boot
?
This seems intended to prevent a user from consecutively running a "none" boot but I believe that should be possible.
Also @sujinmkang does this PR fix sonic-net/sonic-buildimage#8924 ? It looks like it might. I also might suggest fixing sonic-net/sonic-buildimage#8923 while you are in this code too if you want to handle all the fwutil issues I raised in a single pass (up to you totally, just worth mentioning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments please. Thanks.
fwutil/lib.py
Outdated
data = self.read_au_status_file_if_exists(FW_AU_STATUS_FILE_PATH) | ||
if data is not None: | ||
if boot is "none" or boot in data: | ||
click.echo("Allow firmware auto-update {} again on top of the previous {} reboot".format(boot, boot_type)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this been manually tested? Do we have any unit tests for this?
boot_type
is not defined in this latest change as far as I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me as long as this has been tested.
/azp run Azure.sonic-utilities |
Azure Pipelines successfully started running 1 pipeline(s). |
@sujinmkang Can you please sync to the latest? vs tests have been removed and will not run in sonic-utilities. You may also have to add tests for code coverage. |
@qiluo-msft - as discussed, please approve this PR. Thanks. |
Please add unit test. The coverage checker fails. |
…ot fw update (#2040) sonic-net/sonic-buildimage#8928 sonic-net/sonic-buildimage#8926 sonic-net/sonic-buildimage#8925 sonic-net/sonic-buildimage#8924 #### What I did Allow fwutil update all for other boot type if any previous fw update done for "none" boot type #### How I did it Allow fwutil update all for other boot type if any previous fw update done for "none" boot type #### How to verify it 1. Run fwutil update all for boot_type="none" 2. Run fwutil update all for any other boot_type 3. Verify if the 2nd update is proceeded.
sonic-net/sonic-buildimage#8928
sonic-net/sonic-buildimage#8926
sonic-net/sonic-buildimage#8925
sonic-net/sonic-buildimage#8924
What I did
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type
How I did it
Allow fwutil update all for other boot type if any previous fw update done for "none" boot type
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)