@sonic_installer.command('remove')
@click.option('-y', '--yes', is_flag=True, callback=abort_if_false, expose_value=False, prompt='Image will be removed, continue?')
@click.argument('image')
def remove(image):
    ' Uninstall image '
    bootloader = get_bootloader()
    images = bootloader.get_installed_images()
    current = bootloader.get_current_image()
    if (image not in images):
        echo_and_log('Image does not exist', LOG_ERR)
        sys.exit(1)
    if (image == current):
        echo_and_log('Cannot remove current image', LOG_ERR)
        sys.exit(1)
    bootloader.remove_image(image)
Uninstall image
@sonic_installer.command('remove')
@click.option('-y', '--yes', is_flag=True, callback=abort_if_false, expose_value=False, prompt='Image will be removed, continue?')
@click.argument('image')
def remove(image):
    '  '
    bootloader = get_bootloader()
    images = bootloader.get_installed_images()
    current = bootloader.get_current_image()
    if (image not in images):
        echo_and_log('Image does not exist', LOG_ERR)
        sys.exit(1)
    if (image == current):
        echo_and_log('Cannot remove current image', LOG_ERR)
        sys.exit(1)
    bootloader.remove_image(image)