From 42efc0316f990a5232e08e10340a04dcec51216f Mon Sep 17 00:00:00 2001 From: Vaibhav Hemant Dixit Date: Wed, 4 Nov 2020 14:33:30 -0800 Subject: [PATCH] SONiC installer - fix string formatting during image type check (#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. --- sonic_installer/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonic_installer/main.py b/sonic_installer/main.py index ca843c394b..2dae429264 100644 --- a/sonic_installer/main.py +++ b/sonic_installer/main.py @@ -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))