]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-detect-init: Ubuntu >= 15.04 uses systemd 6873/head
authorJames Page <james.page@ubuntu.com>
Wed, 9 Dec 2015 10:34:38 +0000 (10:34 +0000)
committerJames Page <james.page@ubuntu.com>
Wed, 9 Dec 2015 10:36:06 +0000 (10:36 +0000)
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 <james.page@ubuntu.com>
src/ceph-detect-init/ceph_detect_init/debian/__init__.py
src/ceph-detect-init/tests/test_all.py

index 7209ff6ba192a2ad85b85ce748a4ec9b36d0a942..59b47816f470161d53272a94b854ed0a8e5644a5 100644 (file)
@@ -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'
index 069a0ede1f472d23750234814e5bb7cd3f45a43f..4c408f9b507d5f374203c060d587208c68d8210a 100644 (file)
@@ -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',