Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion suse_migration_services/prechecks/cpu_arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def x86_64_version():
)


def cpu_arch():
def cpu_arch(migration_system=False):
"""Function for CPU architecture related checks"""
if migration_system:
# This check must not be called inside of the
# migration system live iso or container image.
# It will only be useful on the system to migrate
# at install time of the Migration package or on
# manual user invocation of suse-migration-pre-checks
# prior the actual migration.
return

x86_64_version()
4 changes: 2 additions & 2 deletions suse_migration_services/prechecks/pre_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def main():
log.info('Checking harmful migration conditions')

log.info('--> Checking system architecture version...')
check_cpu_arch.cpu_arch()
check_cpu_arch.cpu_arch(migration_system=migration_system_mode)

log.info('--> Checking for local private repos...')
check_repos.remote_repos(migration_system=migration_system_mode)
Expand All @@ -117,7 +117,7 @@ def main():
log.info('Done')

log.info('--> Checking high availability extension...')
check_ha.check_ha()
check_ha.check_ha(migration_system=migration_system_mode)
log.info('Done')

log.info('--> Checking wicked to NetworkManager migration...')
Expand Down
4 changes: 3 additions & 1 deletion suse_migration_services/units/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def perform(self):
try:
shutil.copy(cert_file, trust_anchor)
except FileNotFoundError as issue:
self.log.warning('Import of {} failed with {}'.format(cert_file, issue))
self.log.warning(
'Import of {} failed with {}'.format(cert_file, issue)
)
self.log.info('Update certificate pool')
Command.run(['update-ca-certificates'])

Expand Down
4 changes: 4 additions & 0 deletions test/unit/pre_checks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,10 @@ def test_check_x86_64_v2(
assert 'SLE16 requires x86_64_v2 at minimum' not in self._caplog.text
mock_Command_run.assert_called_once_with(['zypper', 'system-architecture'])

mock_Command_run.reset_mock()
check_cpu_arch.cpu_arch(True)
mock_Command_run.assert_not_called()

@patch('suse_migration_services.command.Command.run')
@patch('suse_migration_services.migration_target.MigrationTarget.get_migration_target')
def test_check_x86_64_v1(
Expand Down
Loading