]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: fix ha-rgw removal
authorAdam King <adking@redhat.com>
Fri, 15 Jan 2021 01:04:27 +0000 (20:04 -0500)
committerJuan Miguel Olmo Martínez <jolmomar@redhat.com>
Tue, 26 Jan 2021 09:44:48 +0000 (10:44 +0100)
removing the ha-rgw service from a host was failing due to some
issues with daemon type <-> service type conversions

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 657027088e4d8be4789496020c034aa2837a07b7)

src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/services/cephadmservice.py

index 01f5dd48d74cc2333265d9afdf437aa0529e9699..fd8664e2231d4061143136dd085e56d912f48486 100644 (file)
@@ -1467,7 +1467,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
                 else:
                     spec = ServiceSpec(
                         unmanaged=True,
-                        service_type=dd.daemon_type,
+                        service_type=daemon_type_to_service(dd.daemon_type),
                         service_id=dd.service_id(),
                         placement=PlacementSpec(
                             hosts=[dd.hostname]
index b5f9f0bb3dd8123e1b344930676f9aa285b8be94..b6e1930c5b4468945733fd611929a1183acccd80 100644 (file)
@@ -13,6 +13,7 @@ from mgr_module import HandleCommandResult, MonCommandFailed
 from ceph.deployment.service_spec import ServiceSpec, RGWSpec
 from ceph.deployment.utils import is_ipv6, unwrap_ipv6
 from orchestrator import OrchestratorError, DaemonDescription
+from orchestrator._interface import daemon_type_to_service, service_to_daemon_types
 from cephadm import utils
 from mgr_util import create_self_signed_cert, ServerConfigException, verify_tls
 
@@ -234,7 +235,6 @@ class CephadmService(metaclass=ABCMeta):
         """
         Called before the daemon is removed.
         """
-        assert daemon.daemon_type is not None
         assert self.TYPE == daemon_type_to_service(daemon.daemon_type)
         logger.debug(f'Pre remove daemon {self.TYPE}.{daemon.daemon_id}')
 
@@ -242,7 +242,6 @@ class CephadmService(metaclass=ABCMeta):
         """
         Called after the daemon is removed.
         """
-        assert daemon.daemon_type is not None
         assert self.TYPE == daemon_type_to_service(daemon.daemon_type)
         logger.debug(f'Post remove daemon {self.TYPE}.{daemon.daemon_id}')
 
@@ -274,7 +273,9 @@ class CephService(CephadmService):
         """
         Map the daemon id to a cephx keyring entity name
         """
-        if self.TYPE in ['rgw', 'rbd-mirror', 'nfs', "iscsi", 'haproxy', 'keepalived']:
+        # despite this mapping entity names to daemons, self.TYPE within
+        # the CephService class refers to service types, not daemon types
+        if self.TYPE in ['rgw', 'rbd-mirror', 'nfs', "iscsi", 'ha-rgw']:
             return AuthEntity(f'client.{self.TYPE}.{daemon_id}')
         elif self.TYPE == 'crash':
             if host == "":