From: Nathan Cutler Date: Thu, 3 Mar 2016 18:10:46 +0000 (+0100) Subject: ceph-detect-init: return correct value on recent SUSE distros X-Git-Tag: v10.1.0~191^2~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F7909%2Fhead;p=ceph.git ceph-detect-init: return correct value on recent SUSE distros http://tracker.ceph.com/issues/14770 Fixes: #14770 Signed-off-by: Nathan Cutler --- 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 69bf7c481e7..0c3753b3cbe 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'