]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
Do not enable non-existing ceph service on systemd managed distros. 339/head
authorMilan Broz <gmazyland@gmail.com>
Thu, 6 Aug 2015 11:20:27 +0000 (13:20 +0200)
committerMilan Broz <mbroz@redhat.com>
Thu, 6 Aug 2015 14:40:55 +0000 (16:40 +0200)
Once systemd integration is ready, "systemctl enable ceph" fails
because there is no longer such service (OSD units arte generated).
Enable ceph.target instead.

Signed-off-by: Milan Broz <mbroz@redhat.com>
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/rhel/__init__.py
ceph_deploy/hosts/suse/__init__.py
ceph_deploy/osd.py
ceph_deploy/tests/unit/hosts/test_suse.py

index 6a2a2aa5a31dd0150855c840193f1f585c18c7ae..18ec5479f069643f6857e8e7dc58170b2efa1695 100644 (file)
@@ -68,7 +68,7 @@ def get(hostname,
     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
 
index b36d87d17e7bffe970f92d7480caf84f8d00a161..64e3ed2998ecef30781bc0a043e287421702fbd7 100644 (file)
@@ -12,7 +12,7 @@ release = None
 codename = None
 
 
-def choose_init():    
+def choose_init(module):
     """
     Select a init system
 
index 7453b6ba6ef36a1c3661fc38ce7649fcab1dea61..d3b472fe04a19418838c4825aa5c103f4fbc4821 100644 (file)
@@ -11,7 +11,7 @@ distro = None
 release = None
 codename = None
 
-def choose_init():    
+def choose_init(module):
     """
     Select a init system
 
index 05f219294214e35750a20d2cd35e9ac201762059..990adc1fdccfbb4419178398fbac92c3109061e2 100644 (file)
@@ -12,14 +12,16 @@ distro = None
 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:
index c866247ba5905f421071182cab549778827c77e6..96582fa96d1bb5676535dc0ee46f76d33a670bf3 100644 (file)
@@ -11,7 +11,7 @@ distro = None
 release = None
 codename = None
 
-def choose_init():
+def choose_init(module):
     """
     Select a init system
 
index e2900e720aec68406aee809bcdf29b823334f010..6d5d73e3160e8299f6f40df479afa505ba74f696 100644 (file)
@@ -15,7 +15,7 @@ distro = None
 release = None
 codename = None
 
-def choose_init():
+def choose_init(module):
     """
     Select a init system
 
index f5c0bc7e40090e950ad644968e076c7a7f0f4581..b3e8a8d1691bfb1c330ae08b7b68214be44b69a8 100644 (file)
@@ -379,8 +379,10 @@ def activate(args, cfg):
         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()
 
index 3998e2938d8c981cc80464dcfd5c780b11022fa6..800b3e70f72cf63d42371537b0a88eafe5485e4d 100644 (file)
@@ -7,22 +7,22 @@ class TestSuseInit(object):
 
     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):