Skip to content

Commit

Permalink
Add workaround for bsc#1217583
Browse files Browse the repository at this point in the history
A specific registercloudguest on a specific SP version has issue that
result in a warning about IPv6 to result in a registration failure due
to an error in its internal exception handling.
Issue has been already fixed but on BYOS images needs image to be
registered that is not possible due to the bug itself.
Temporary use SUSEConnect in this particular situation waiting for an
image refresh.
  • Loading branch information
mpagot committed Jan 10, 2025
1 parent 012567c commit a80aabd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/publiccloud/utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use strict;
use warnings;
use testapi;
use utils;
use version_utils qw(is_sle is_public_cloud get_version_id is_transactional is_openstack is_sle_micro);
use version_utils qw(is_sle is_public_cloud get_version_id is_transactional is_openstack is_sle_micro check_version);
use transactional qw(reboot_on_changes trup_call process_reboot);
use registration;
use maintenance_smelt qw(is_embargo_update);
Expand Down Expand Up @@ -113,8 +113,15 @@ sub registercloudguest {
my $path = is_sle('>15') && is_sle('<15-SP3') ? '/usr/sbin/' : '';
my $suseconnect = $path . get_var("PUBLIC_CLOUD_SCC_ENDPOINT", "registercloudguest");
my $cmd_time = time();

# Check what version of registercloudguest binary we use
$instance->ssh_script_run(cmd => "rpm -qa cloud-regionsrv-client");
my $version = $instance->ssh_script_output(cmd => "rpm -qa cloud-regionsrv-client");
# Only a specific version of the package has issue and only on a specific SP
# Do not activate the workaround if the user explicitly decide using a specific ENDPOINT
if (is_sle('15-SP2+') && check_version('<10.1.7', $version) && check_var('PUBLIC_CLOUD_SCC_ENDPOINT', 'SUSEConnect')) {
record_soft_failure("bsc#1217583 IPv6 handling during registration. Force use SUSEConnect to work around it.");
$suseconnect = 'SUSEConnect';
}
$instance->ssh_script_retry(cmd => "sudo $suseconnect -r $regcode", timeout => 420, retry => 3, delay => 120);
if (script_run('ssh -O check ' . $instance->username . '@' . $instance->public_ip) == 0) {
assert_script_run('ssh -O exit ' . $instance->username . '@' . $instance->public_ip);
Expand Down

0 comments on commit a80aabd

Please sign in to comment.