Skip to content

Commit 42efc03

Browse files
authored
SONiC installer - fix string formatting during image type check (sonic-net#1197)
* 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.
1 parent 061f428 commit 42efc03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sonic_installer/main.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ def install(url, force, skip_migration=False):
314314
else:
315315
# Verify that the binary image is of the same type as the running image
316316
if not bootloader.verify_binary_image(image_path) and not force:
317-
click.echo("Image file '{}' is of a different type than running image.\n"
318-
"If you are sure you want to install this image, use -f|--force.\n"
319-
"Aborting...".format(image_path))
317+
click.echo("Image file '{}' is of a different type than running image.\n".format(url) +
318+
"If you are sure you want to install this image, use -f|--force.\n" +
319+
"Aborting...")
320320
raise click.Abort()
321321

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

0 commit comments

Comments
 (0)