]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
now correctly selects sysvinit or systemd for SLE_11 SLE_12 and openSUSE_13.1
authorOwen Synge <osynge@suse.com>
Fri, 11 Jul 2014 12:47:11 +0000 (14:47 +0200)
committerOwen Synge <osynge@suse.com>
Fri, 11 Jul 2014 12:47:11 +0000 (14:47 +0200)
ceph_deploy/hosts/__init__.py
ceph_deploy/hosts/centos/__init__.py
ceph_deploy/hosts/debian/__init__.py
ceph_deploy/hosts/fedora/__init__.py
ceph_deploy/hosts/suse/__init__.py

index a80a7049d82b52e68c3d0656f4b12c1984caa113..028b800c92e77c1abb4b3627f4d698480d0186fa 100644 (file)
@@ -55,8 +55,7 @@ def get(hostname, username=None, fallback=None):
     module.codename = codename
     module.conn = conn
     module.machine_type = machine_type
-    module.init = _choose_init(distro_name, codename)
-
+    module.init = module.choose_init()
     return module
 
 
@@ -87,14 +86,3 @@ def _normalized_distro_name(distro):
     elif distro.startswith(('suse', 'opensuse')):
         return 'suse'
     return distro
-
-
-def _choose_init(distro, codename):
-    """
-    Select a init system for a given distribution.
-
-    Returns the name of a init system (upstart, sysvinit ...).
-    """
-    if distro == 'Ubuntu':
-        return 'upstart'
-    return 'sysvinit'
index c03ed635bb3a1cfd538b6418fc23b53f472fad6b..d9765234c8cd3b43be9cc5820e99f2c352d18c53 100644 (file)
@@ -9,3 +9,6 @@ from uninstall import uninstall  # noqa
 distro = None
 release = None
 codename = None
+
+def choose_init():
+    return 'sysvinit'
index c2805bd5f3f33b41a4cd1eba559fa045a41cb615..f82537e50dd55d8eb8af30b3abbd8c58d22e94a2 100644 (file)
@@ -9,3 +9,8 @@ from uninstall import uninstall  # noqa
 distro = None
 release = None
 codename = None
+
+def choose_init():
+    if distro == 'Ubuntu':
+        return 'upstart'
+    return 'sysvinit'
index 0bfd29f2031b101b0063cc1794eda98b71785e58..9f0f2bc73bee64ce96b245c87ca3c04f8d28517e 100644 (file)
@@ -10,3 +10,6 @@ from uninstall import uninstall  # noqa
 distro = None
 release = None
 codename = None
+
+def choose_init():
+    return 'sysvinit'
index c2805bd5f3f33b41a4cd1eba559fa045a41cb615..33e19a95f609d6b3f2a133cbd9d8506dfe8893d2 100644 (file)
@@ -2,10 +2,23 @@ import mon  # noqa
 import pkg  # noqa
 from install import install, mirror_install, repo_install  # noqa
 from uninstall import uninstall  # noqa
+import logging
 
 # Allow to set some information about this distro
 #
 
+log = logging.getLogger(__name__)
+
 distro = None
 release = None
 codename = None
+
+def choose_init():
+    initMapping = { '11' : 'sysvinit',  # SLE_11
+        '12' : 'systemd',               # SLE_12
+        '13.1' : 'systemd',             # openSUSE_13.1
+        }
+    if release in initMapping:
+        log.debug("init=%s" % (initMapping[release]))
+        return initMapping[release]
+    return 'sysvinit'