SUSE / suse-migration-services

GNU General Public License v3.0
7 stars 11 forks source link

Avoid stack trace when multiversion entries in zypp.conf are commented out #255

Closed KeithMnemonic closed 1 year ago

KeithMnemonic commented 1 year ago

Currently, if the following entries in /etc/zypp/zypp.conf

multiversion = provides:multiversion(kernel)

multiversion.kernels = latest,running

this will lead to a stack trace

Traceback (most recent call last): File "/usr/bin/suse-migration-pre-checks", line 11, in load_entry_point('suse-migration-services==2.0.34', 'console_scripts', 'suse-migration-pre-checks')() File "/usr/lib/python3.4/site-packages/suse_migration_services/prechecks/pre_checks.py", line 82, in main check_multi_kernels.multiversion_and_multiple_kernels(fix=args.fix, migration_system=migration_system_mode) File "/usr/lib/python3.4/site-packages/suse_migration_services/prechecks/kernels.py", line 42, in multiversion_and_multiple_kernels multiversion_settings(fix, migration_system, log) File "/usr/lib/python3.4/site-packages/suse_migration_services/prechecks/kernels.py", line 58, in multiversion_settings if 'kernel' in kernel_multi_version_enabled: TypeError: argument of type 'NoneType' is not iterable warning: %post(SLES15-Migration-2.0.34-6.x86_64) scriptlet failed, exit status 1

This stacktrace error should not occur but rather a message indicating the lines are not present.