Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detection of service pack on SLES15 #1006

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
17 changes: 13 additions & 4 deletions lib/FusionInventory/Agent/Task/Inventory/Linux/Distro/NonLSB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,19 @@ sub _getDistroData {
};

if ($name eq 'SuSE') {
$data->{SERVICE_PACK} = getFirstMatch(
file => '/etc/SuSE-release',
pattern => qr/^PATCHLEVEL = ([0-9]+)/
);
# SLES15 doesn't have /etc/SuSE-release
if (-e '/etc/SuSE-release') {
$data->{SERVICE_PACK} = getFirstMatch(
file => '/etc/SuSE-release',
pattern => qr/^PATCHLEVEL = ([0-9]+)/
);
} else {
# fall back by checking if there's a -SP in the current version
# if so, split by -SP
if ($version =~ m/\-SP.+/) {
($data->{VERSION}, $data->{SERVICE_PACK}) = $version =~ m/(.*)-SP(.*)/;
}
}
}

return $data;
Expand Down