From 62731d029803f84fb831d1852b8e96940329587f Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Thu, 3 Mar 2016 19:10:46 +0100 Subject: [PATCH] ceph-detect-init: return correct value on recent SUSE distros http://tracker.ceph.com/issues/14770 Fixes: #14770 Signed-off-by: Nathan Cutler --- src/ceph-detect-init/ceph_detect_init/suse/__init__.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ceph-detect-init/ceph_detect_init/suse/__init__.py b/src/ceph-detect-init/ceph_detect_init/suse/__init__.py index 69bf7c481e72..0c3753b3cbed 100644 --- a/src/ceph-detect-init/ceph_detect_init/suse/__init__.py +++ b/src/ceph-detect-init/ceph_detect_init/suse/__init__.py @@ -8,10 +8,6 @@ def choose_init(): Returns the name of a init system (upstart, sysvinit ...). """ - init_mapping = { - '11': 'sysvinit', # SLE_11 - '12': 'systemd', # SLE_12 - '13.1': 'systemd', # openSUSE_13.1 - '13.2': 'systemd', # openSUSE_13.2 - } - return init_mapping.get(release, 'sysvinit') + if release and int(release.split('.')[0]) >= 12: + return 'systemd' + return 'sysvinit' -- 2.47.3