From: Loic Dachary Date: Thu, 27 Aug 2015 20:08:46 +0000 (+0200) Subject: ceph-disk: CentOS 7 is systemd X-Git-Tag: v9.1.0~252^2~1^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c586e63d3955a586e9e922c1b655b3cf2250e27;p=ceph.git ceph-disk: CentOS 7 is systemd http://tracker.ceph.com/issues/12786 Fixes: #12786 Signed-off-by: Loic Dachary --- diff --git a/src/ceph-detect-init/ceph_detect_init/centos/__init__.py b/src/ceph-detect-init/ceph_detect_init/centos/__init__.py index f7bf85beda8..b9738a73b39 100644 --- a/src/ceph-detect-init/ceph_detect_init/centos/__init__.py +++ b/src/ceph-detect-init/ceph_detect_init/centos/__init__.py @@ -8,4 +8,6 @@ def choose_init(): Returns the name of a init system (upstart, sysvinit ...). """ + if release and int(release.split('.')[0]) >= 7: + return 'systemd' return 'sysvinit' diff --git a/src/ceph-detect-init/tests/test_all.py b/src/ceph-detect-init/tests/test_all.py index 68189bf0187..72aa9e96f21 100644 --- a/src/ceph-detect-init/tests/test_all.py +++ b/src/ceph-detect-init/tests/test_all.py @@ -38,6 +38,9 @@ logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', class TestCephDetectInit(testtools.TestCase): def test_centos(self): + with mock.patch('ceph_detect_init.centos.release', + '7.0'): + self.assertEqual('systemd', centos.choose_init()) self.assertEqual('sysvinit', centos.choose_init()) def test_debian(self):