]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[BZ-1282484] use is_upstart detection on debian init check 385/head
authorAlfredo Deza <adeza@redhat.com>
Tue, 2 Feb 2016 16:17:11 +0000 (11:17 -0500)
committerAlfredo Deza <adeza@redhat.com>
Tue, 2 Feb 2016 17:17:23 +0000 (12:17 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph_deploy/hosts/debian/__init__.py

index b2ece01b2443d056b8048e3c45056d5a8d2a2703..91b729fd5ed5969a252bcb76f48fc5eefaca4e87 100644 (file)
@@ -2,6 +2,7 @@ import mon  # noqa
 from install import install, mirror_install, repo_install  # noqa
 from uninstall import uninstall  # noqa
 from ceph_deploy.util import pkg_managers
+from ceph_deploy.util.system import is_systemd, is_upstart
 
 # Allow to set some information about this distro
 #
@@ -10,17 +11,20 @@ distro = None
 release = None
 codename = None
 
+
 def choose_init(module):
     """
     Select a init system
 
     Returns the name of a init system (upstart, sysvinit ...).
     """
-    # fixme: newer ubuntu runs systemd
-    if distro.lower() == 'ubuntu':
-        return 'upstart'
-    if module.conn.remote_module.path_exists("/lib/systemd/system/ceph.target"):
+    if is_systemd(module.conn) or module.conn.remote_module.path_exists(
+            "/lib/systemd/system/ceph.target"):
         return 'systemd'
+
+    if is_upstart(module.conn):
+        return 'upstart'
+
     return 'sysvinit'