Project

General

Profile

Actions

Bug #13964

closed

Os name for sles 12 is not correct in 5.0 inventories

Added by Félix DALLIDET over 5 years ago. Updated about 5 years ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Fix check:
Regression:

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>

Actions #1

Updated by Félix DALLIDET over 5 years ago

  • Status changed from New to In progress
  • Assignee set to Félix DALLIDET
Actions #2

Updated by Félix DALLIDET over 5 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
Actions #3

Updated by Félix DALLIDET over 5 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
Actions #4

Updated by Félix DALLIDET over 5 years ago

  • Assignee changed from Félix DALLIDET to Nicolas CHARLES
Actions #5

Updated by Félix DALLIDET over 5 years ago

  • Status changed from Pending technical review to Pending release
Actions #6

Updated by Vincent MEMBRÉ about 5 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
Actions #7

Updated by Vincent MEMBRÉ about 5 years ago

  • Status changed from Pending release to Released
This bug has been fixed in Rudder 5.0.4 which was released today.
Changelog
Actions #8

Updated by Félix DALLIDET about 5 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.

Actions #9

Updated by Nicolas CHARLES about 5 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

Actions #10

Updated by Nicolas CHARLES about 5 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

Actions #11

Updated by Félix DALLIDET about 5 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

Actions

Also available in: Atom PDF