module.codename = codename
module.conn = conn
module.machine_type = machine_type
- module.init = module.choose_init()
+ module.init = module.choose_init(module)
module.packager = module.get_packager(module)
return module
release = None
codename = None
-def choose_init():
+def choose_init(module):
"""
Select a init system
Returns the name of a init system (upstart, sysvinit ...).
"""
- return 'systemd'
-
+ if module.normalized_release.int_major >= 22:
+ return 'systemd'
+ else:
+ return 'sysvinit'
def get_packager(module):
if module.normalized_release.int_major >= 22:
time.sleep(5)
catch_osd_errors(distro.conn, distro.conn.logger, args)
- if distro.is_el:
- system.enable_service(distro.conn)
+ if distro.init == 'systemd':
+ system.enable_service(distro.conn, "ceph.target")
+ elif distro.init == 'sysvinit':
+ system.enable_service(distro.conn, "ceph")
distro.conn.exit()
def test_choose_init_default(self):
self.host.release = None
- init_type = self.host.choose_init()
+ init_type = self.host.choose_init(self.host)
assert init_type == "sysvinit"
-
+
def test_choose_init_SLE_11(self):
self.host.release = '11'
- init_type = self.host.choose_init()
+ init_type = self.host.choose_init(self.host)
assert init_type == "sysvinit"
def test_choose_init_SLE_12(self):
self.host.release = '12'
- init_type = self.host.choose_init()
+ init_type = self.host.choose_init(self.host)
assert init_type == "systemd"
def test_choose_init_openSUSE_13_1(self):
self.host.release = '13.1'
- init_type = self.host.choose_init()
+ init_type = self.host.choose_init(self.host)
assert init_type == "systemd"
class TestSuseMapComponents(object):