Skip to content

Commit

Permalink
[sonic_installer] temporary fix: don't migrate packages on aboot plat…
Browse files Browse the repository at this point in the history
…forms (#1607)

What I did
Skip sonic package migration on aboot platform.

How I did it
Added a warning and skip the migration.

How to verify it
I changed AbootBootloader to OnieInstallerBootloader to test on my Onie device. I don't have Aboot device.
  • Loading branch information
stepanblyschak authored May 11, 2021
1 parent fde1d95 commit 9fc630c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sonic_installer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from swsscommon.swsscommon import SonicV2Connector

from .bootloader import get_bootloader
from .bootloader.aboot import AbootBootloader
from .common import (
run_command, run_command_or_raise,
IMAGE_PREFIX,
Expand All @@ -23,7 +24,7 @@
from .exception import SonicRuntimeException

SYSLOG_IDENTIFIER = "sonic-installer"
LOG_ERR = logger.Logger.LOG_PRIORITY_ERROR
LOG_ERR = logger.Logger.LOG_PRIORITY_ERROR
LOG_NOTICE = logger.Logger.LOG_PRIORITY_NOTICE

# Global Config object
Expand Down Expand Up @@ -140,7 +141,7 @@ def echo_and_log(msg, priority=LOG_NOTICE, fg=None):
else:
click.secho(msg, fg=fg)
log.log(priority, msg, False)


# Function which validates whether a given URL specifies an existent file
# on a reachable remote machine. Will abort the current operation if not
Expand Down Expand Up @@ -323,7 +324,7 @@ def migrate_sonic_packages(bootloader, binary_image_version):

with contextlib.ExitStack() as stack:
def get_path(path):
""" Closure to get path by entering
""" Closure to get path by entering
a context manager of bootloader.get_path_in_image """

return stack.enter_context(bootloader.get_path_in_image(new_image_dir, path))
Expand Down Expand Up @@ -433,6 +434,10 @@ def install(url, force, skip_migration=False, skip_package_migration=False):

update_sonic_environment(bootloader, binary_image_version)

if isinstance(bootloader, AbootBootloader) and not skip_package_migration:
echo_and_log("Warning: SONiC package migration is not supported currenty on aboot platform due to https://github.com/Azure/sonic-buildimage/issues/7566.", LOG_ERR, fg="red")
skip_package_migration = True

if not skip_package_migration:
migrate_sonic_packages(bootloader, binary_image_version)

Expand Down

0 comments on commit 9fc630c

Please sign in to comment.