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
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'
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'