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

Add ImageService.set_next_boot for GNOI Activate OS. #207

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hdwhdw
Copy link
Contributor

@hdwhdw hdwhdw commented Jan 23, 2025

Add a method set_next_boot to the ImageService interface.

This method will set the next boot image to the specified image.

This is used to implement GNOI OS.Activate.

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@hdwhdw hdwhdw requested a review from Copilot January 23, 2025 22:01

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

host_modules/image_service.py:180

  • The error message handling might miss relevant error messages that do not contain the word 'Error'. Consider capturing all lines from stderr.
if "Error" in line:
@mssonicbld
Copy link

/azp run

@hdwhdw hdwhdw requested a review from Copilot January 23, 2025 22:37

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft
Copy link
Contributor

Could you provide some sample test result in PR description?
Assume you can just use gnmi_cli to trigger test.

logger.info("Setting the next boot image to {}".format(image))
cmd = ["/usr/local/bin/sonic-installer", "set-next-boot", image]
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
msg = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no successful message?

result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
msg = ""
if result.returncode:
msg = result.stderr.decode()
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, recommend to log error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants