Bug #13964
closedOs name for sles 12 is not correct in 5.0 inventories
Description
When running a scenario on a sles12 machine with RTF, the initial tests contain an inventory sample test.
It fails because the OS_NAME is '%s' which is for sure not wanted.
It was seen on a 5.0.4
<HARDWARE> <ARCHNAME>x86_64-linux-thread-multi</ARCHNAME> <CHASSIS_TYPE>Other</CHASSIS_TYPE> <CHECKSUM>131071</CHECKSUM> <DATELASTLOGGEDUSER>Wed Dec 12 16:34</DATELASTLOGGEDUSER> <DNS>8.8.8.8/8.8.4.4</DNS> <ETIME>1</ETIME> <IPADDR>10.0.2.15/192.168.41.2</IPADDR> <LASTLOGGEDUSER>vagrant</LASTLOGGEDUSER> <MEMORY>1481</MEMORY> <NAME>server</NAME> <OSCOMMENTS>#1 SMP Tue May 29 21:04:44 UTC 2018 (cd0437b)</OSCOMMENTS> <OSNAME>%s</OSNAME> <OSVERSION>4.12.14-23-default</OSVERSION> <PROCESSORN>1</PROCESSORN> <PROCESSORT>Intel Core Processor (Haswell, no TSX)</PROCESSORT> <UUID>3DB5964D-76A0-4374-B86F-9A2CC09CE8F9</UUID> <VMSYSTEM>VirtualBox</VMSYSTEM> </HARDWARE>
Updated by Félix DALLIDET almost 6 years ago
- Status changed from New to In progress
- Assignee set to Félix DALLIDET
Updated by Félix DALLIDET almost 6 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Félix DALLIDET to Nicolas CHARLES
- Pull Request set to https://github.com/Normation/rudder-packages/pull/1739
Updated by Félix DALLIDET almost 6 years ago
- Subject changed from error in inventory on sles12 to Add support to os-release file in inventory
- Assignee changed from Nicolas CHARLES to Félix DALLIDET
Updated by Félix DALLIDET almost 6 years ago
- Assignee changed from Félix DALLIDET to Nicolas CHARLES
Updated by Félix DALLIDET almost 6 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder-packages|4643369ea6d7ad02188bc0494d17ecb38780614e.
Updated by Vincent MEMBRÉ almost 6 years ago
- Subject changed from Add support to os-release file in inventory to Os name for sles 12 is not correct in 5.0 inventories
Updated by Vincent MEMBRÉ almost 6 years ago
- Status changed from Pending release to Released
Changelog
Updated by Félix DALLIDET almost 6 years ago
To give more details: starting from sles15, sles will only support /etc/os-release to identify the current os version.
See the doc of sles12 https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/#fate-316268.
I added support for /etc/os-release in our fusion inventory agent, following the current official fusion inventory agent.
But this seems to break compatibility on systems where inventory was previously based on a specific file like /etc/redhat-release but also have an /etc/os-release since the name, versions, etc... can be specified in different manners.
Updated by Nicolas CHARLES almost 6 years ago
This breaks at least Redhat and SLES12 (both appears as Other Linux within rudder), and Centos which has version 7 (core) rather than 7.4
Updated by Nicolas CHARLES almost 6 years ago
On SLES12
/etc/os-release
NAME="SLES" VERSION="12-SP1" VERSION_ID="12.1" PRETTY_NAME="SUSE Linux Enterprise Server 12 SP1" ID="sles" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:suse:sles:12:sp1"
/etc/SuSE-release
SUSE Linux Enterprise Server 12 (x86_64) VERSION = 12 PATCHLEVEL = 1 # This file is deprecated and will be removed in a future service pack or release. # Please check /etc/os-release for details about this release.
on Rudder pre-5.0.4, it returns SuSE, version 12.1
on Rudder post-5.0.4, it returns SUSE Linux Enterprise Server 12 SP1 - VERSION12-SP1
Updated by Félix DALLIDET almost 6 years ago
On SLES 15:
NAME="SLES" VERSION="15" VERSION_ID="15" PRETTY_NAME="SUSE Linux Enterprise Server 15" ID="sles" ID_LIKE="suse" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:suse:sles:15"
Only another file, /etc/SUSE-brand
SLE VERSION = 15
if lsb_release is installed:
server:/opt/rudder/lib/perl5/FusionInventory/Agent/Task/Inventory/Linux/Distro # lsb_release -a LSB Version: n/a Distributor ID: SUSE Description: SUSE Linux Enterprise Server 15 Release: 15 Codename: n/a