Skip to content

Commit

Permalink
SONiC installer - fix string formatting during image type check (#1197)
Browse files Browse the repository at this point in the history
* SONiC installer - fix string formatting during image typer check
`sonic_installer` error message misses the filename due to string formatting error. This fixes the missing string substitution in the message:
Before - Image file '{}' is of a different type than running image.
Now - Image file 'sonic-broadcom.bin' is of a different type than running image.
  • Loading branch information
vaibhavhd authored Nov 4, 2020
1 parent 061f428 commit 42efc03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sonic_installer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ def install(url, force, skip_migration=False):
else:
# Verify that the binary image is of the same type as the running image
if not bootloader.verify_binary_image(image_path) and not force:
click.echo("Image file '{}' is of a different type than running image.\n"
"If you are sure you want to install this image, use -f|--force.\n"
"Aborting...".format(image_path))
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...")
raise click.Abort()

click.echo("Installing image {} and setting it as default...".format(binary_image_version))
Expand Down

0 comments on commit 42efc03

Please sign in to comment.