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

SONiC installer - fix string formatting during image type check #1197

Merged
merged 2 commits into from
Nov 4, 2020

Conversation

vaibhavhd
Copy link
Contributor

- What I did
sonic_installer error message misses the filename due to string formatting error.
This fixes the missing string substitution in the message:
Before (note that {} is missing the variable name.):

Downloading image...
Image file '{}' is of a different type than running image.
If you are sure you want to install this image, use -f|--force.
Aborting...
Aborted!

Now:

Downloading image...
...95%, 724 MB, 57044 KB/s, 0 seconds left...   Image file 'sonic-broadcom.bin' is of a different type than running image.
If you are sure you want to install this image, use -f|--force.
Aborting...
Aborted!

- How I did it

- How to verify it
Verified in a DUT, the error message is now printed correctly.

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

Comment on lines 317 to 319
click.echo("Image file '{}' is of a different type than running image.\n".format(url) +\
"If you are sure you want to install this image, use -f|--force.\n" +\
"Aborting...")
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the backslashes necessary, since the entire statement is enclosed in parentheses?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed them. They were redundant.

@vaibhavhd
Copy link
Contributor Author

Retest this please

2 similar comments
@vaibhavhd
Copy link
Contributor Author

Retest this please

@vaibhavhd
Copy link
Contributor Author

Retest this please

@vaibhavhd
Copy link
Contributor Author

@jleveque do you approve to merge this with the test errors that are seen?

@jleveque
Copy link
Contributor

jleveque commented Nov 4, 2020

It looks like the test failures are completely unrelated, but let's try once more.

@jleveque
Copy link
Contributor

jleveque commented Nov 4, 2020

Retest this please.

@vaibhavhd vaibhavhd merged commit 42efc03 into sonic-net:master Nov 4, 2020
@vaibhavhd vaibhavhd deleted the string-format-fix branch November 4, 2020 22:33
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.

3 participants