From: James Page Date: Wed, 9 Dec 2015 10:34:38 +0000 (+0000) Subject: ceph-detect-init: Ubuntu >= 15.04 uses systemd X-Git-Tag: v10.0.2~42^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=26008e8a7299acf8f7599f6d7019b60ccd44fa56;p=ceph.git ceph-detect-init: Ubuntu >= 15.04 uses systemd Ubuntu releases since Ubuntu 15.04 use systemd instead of upstart; teach ceph-detect-init that this is the case, thus avoiding OSD devices on systemd based installs being marked as managed by upstart by ceph-disk. Signed-off-by: James Page --- diff --git a/src/ceph-detect-init/ceph_detect_init/debian/__init__.py b/src/ceph-detect-init/ceph_detect_init/debian/__init__.py index 7209ff6ba192..59b47816f470 100644 --- a/src/ceph-detect-init/ceph_detect_init/debian/__init__.py +++ b/src/ceph-detect-init/ceph_detect_init/debian/__init__.py @@ -9,5 +9,8 @@ def choose_init(): Returns the name of a init system (upstart, sysvinit ...). """ if distro.lower() in ('ubuntu', 'linuxmint'): - return 'upstart' + if codename >= 'vivid': + return 'systemd' + else: + return 'upstart' return 'sysvinit' diff --git a/src/ceph-detect-init/tests/test_all.py b/src/ceph-detect-init/tests/test_all.py index 069a0ede1f47..4c408f9b507d 100644 --- a/src/ceph-detect-init/tests/test_all.py +++ b/src/ceph-detect-init/tests/test_all.py @@ -50,6 +50,9 @@ class TestCephDetectInit(testtools.TestCase): with mock.patch('ceph_detect_init.debian.distro', 'ubuntu'): self.assertEqual('upstart', debian.choose_init()) + with mock.patch('ceph_detect_init.debian.codename', + 'vivid'): + self.assertEqual('systemd', debian.choose_init()) def test_fedora(self): with mock.patch('ceph_detect_init.fedora.release',