Project

General

Profile

Bug #8654

Parsing /etc/lsb-release for OSD metadata is not portable

Added by Danny Al-Gaaf over 9 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
OSD
Target version:
-
% Done:

100%

Spent time:
Source:
Community (dev)
Tags:
Backport:
firefly
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Using /etc/lsb-release to get information about the distro is not recommended since it's not portable.

Example: cat /etc/lsb-release (Debian/Ubuntu)

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu Trusty Tahr (development branch)"

Example from SUSE:

LSB_VERSION="core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64"

The only portable way to get this info is to use 'lsb_release -a'

Associated revisions

Revision 0b3a3987 (diff)
Added by Danny Al-Gaaf over 9 years ago

osd/OSD.cc: parse lsb release data via lsb_release

Use lsb_release tool to be portable since parsing /etc/lsb-release
is not the same between different distributions. The old code failed
e.g. for SUSE products to parse LSB information.

Fixes: #8654

Signed-off-by: Danny Al-Gaaf <>

Revision 5d7add93
Added by Loïc Dachary over 9 years ago

Merge pull request #2017 from ceph/wip-8654

Fix #8654 - OSD.cc: parse LSB data via lsb_release

Reviewed-by: Sage Weil <>
Reviewed-by: Loic Dachary <>

Revision 5be6f2f6 (diff)
Added by Danny Al-Gaaf about 9 years ago

osd/OSD.cc: parse lsb release data via lsb_release

Use lsb_release tool to be portable since parsing /etc/lsb-release
is not the same between different distributions. The old code failed
e.g. for SUSE products to parse LSB information.

Fixes: #8654

Signed-off-by: Danny Al-Gaaf <>
(cherry picked from commit 0b3a3987d382ff33fdf892f189b30df22be80e59)

History

#1 Updated by Danny Al-Gaaf over 9 years ago

Output from lsb_release -a:

$ lsb_release -a

LSB Version:    core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch        
Distributor ID: SUSE LINUX
Description: openSUSE 12.2 (x86_64)
Release: 12.2
Codename: Mantis

From Ubuntu:

Distributor ID:    Ubuntu
Description: Ubuntu Trusty Tahr (development branch)
Release: 14.04
Codename: trusty

#2 Updated by Danny Al-Gaaf over 9 years ago

  • % Done changed from 0 to 100

#3 Updated by Sage Weil over 9 years ago

  • Status changed from New to Resolved

#4 Updated by Loïc Dachary about 9 years ago

  • Backport set to firefly

#5 Updated by Loïc Dachary about 9 years ago

  • Status changed from Resolved to Pending Backport

#6 Updated by Loïc Dachary almost 9 years ago

5be6f2f osd/OSD.cc: parse lsb release data via lsb_release (in firefly),

#7 Updated by Loïc Dachary almost 9 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF