Skip to content

Commit

Permalink
tools: ceph-detect-init: support SLED
Browse files Browse the repository at this point in the history
SUSE Linux Enterprise (SLE) comes in two variants: SLES (for servers) and SLED
(for desktops). This commit adds support for the desktop variant as well as
adding test cases for SLE 15.

This commit is not cherry-picked because ceph-detect-init has been dropped in
master.

References: http://tracker.ceph.com/issues/18163
Signed-off-by: Nathan Cutler <ncutler@suse.com>
  • Loading branch information
smithfarm committed Jul 18, 2018
1 parent bd3b97c commit 07bff85
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ceph-detect-init/ceph_detect_init/__init__.py
Expand Up @@ -92,7 +92,7 @@ def _normalized_distro_name(distro):
return 'redhat'
elif distro.startswith(('scientific', 'scientific linux')):
return 'scientific'
elif distro.startswith(('suse', 'opensuse', 'sles')):
elif distro.startswith(('suse', 'opensuse', 'sles', 'sled')):
return 'suse'
elif distro.startswith('centos'):
return 'centos'
Expand Down
28 changes: 28 additions & 0 deletions src/ceph-detect-init/tests/test_all.py
Expand Up @@ -451,6 +451,34 @@ def test_extract_from_os_release(self):
os_release_sles_12_3, 'ID'))
self.assertEqual('12.3', ceph_detect_init._extract_from_os_release(
os_release_sles_12_3, 'VERSION_ID'))
os_release_sled_15 = """
NAME="SLED"
VERSION="15"
VERSION_ID="15"
PRETTY_NAME="SUSE Linux Enterprise Desktop 15"
ID="sled"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sled:15"
"""
self.assertEqual('sled', ceph_detect_init._extract_from_os_release(
os_release_sled_15, 'ID'))
self.assertEqual('15', ceph_detect_init._extract_from_os_release(
os_release_sled_15, 'VERSION_ID'))
os_release_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"
"""
self.assertEqual('sles', ceph_detect_init._extract_from_os_release(
os_release_sles_15, 'ID'))
self.assertEqual('15', ceph_detect_init._extract_from_os_release(
os_release_sles_15, 'VERSION_ID'))
os_release_opensuse_tumbleweed_old_style = """
NAME="openSUSE Tumbleweed"
# VERSION="20170502"
Expand Down

0 comments on commit 07bff85

Please sign in to comment.