diff --git a/lib/registration.pm b/lib/registration.pm index 7e998ff3536c..b98cf5bcc193 100644 --- a/lib/registration.pm +++ b/lib/registration.pm @@ -369,14 +369,16 @@ sub _yast_scc_addons_handler { sub skip_package_hub_if_necessary { my ($addon) = @_; + my $skip_package_hub = 0; if (is_sle('15-SP2+') && $addon eq 'phub') { if (check_var('FLAVOR', 'Online')) { record_soft_failure('bsc#1151373 - Missing or broken repository after registering module PackageHub'); } elsif (check_var('FLAVOR', 'Full')) { record_info('Full media: no PHUB', 'Skipping Package Hub, it is not available on offline scenarios - bsc#1157659'); } - next; + $skip_package_hub = 1; } + return $skip_package_hub; } sub process_scc_register_addons { @@ -420,7 +422,7 @@ sub process_scc_register_addons { @scc_addons = grep { $_ ne '' } @scc_addons; for my $addon (@scc_addons) { - skip_package_hub_if_necessary($addon); + next if (skip_package_hub_if_necessary($addon)); if (check_var('VIDEOMODE', 'text') || check_var('SCC_REGISTER', 'console')) { # The actions of selecting scc addons have been changed on SP2 or later in textmode # For online migration, we have to do registration on pre-created HDD, set a flag diff --git a/tests/installation/addon_products_sle.pm b/tests/installation/addon_products_sle.pm index c8966809fb86..ab7684f97e8c 100644 --- a/tests/installation/addon_products_sle.pm +++ b/tests/installation/addon_products_sle.pm @@ -78,7 +78,7 @@ sub handle_all_packages_medium { my @addons_with_license = qw(ha we); my @addons_license_tags = (); for my $i (@addons) { - skip_package_hub_if_necessary($i); + next if (skip_package_hub_if_necessary($i)); push @addons_license_tags, "addon-license-$i" if grep(/^$i$/, @addons_with_license); send_key 'home'; send_key_until_needlematch "addon-products-all_packages-$i-highlighted", 'down', 30; @@ -112,7 +112,7 @@ sub handle_all_packages_medium { assert_screen "addon-products-nonempty"; # Confirm all required addons are properly added foreach (@addons) { - skip_package_hub_if_necessary($_); + next if (skip_package_hub_if_necessary($_)); send_key 'home'; send_key_until_needlematch "addon-products-$_", 'down'; }