mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
mgr/cephadm: make ceph orch {restart|...}
asynchronous
Othwerwiese we'd block the CLI handler thread. Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
This commit is contained in:
parent
80cbe7ecaa
commit
c6e4b9ab9c
@ -1527,22 +1527,12 @@ To check that the host is reachable:
|
||||
|
||||
@trivial_completion
|
||||
def service_action(self, action: str, service_name: str) -> List[str]:
|
||||
args = []
|
||||
for host, dm in self.cache.daemons.items():
|
||||
for name, d in dm.items():
|
||||
if d.matches_service(service_name):
|
||||
args.append((d.daemon_type, d.daemon_id,
|
||||
d.hostname, action))
|
||||
dds: List[DaemonDescription] = self.cache.get_daemons_by_service(service_name)
|
||||
self.log.info('%s service %s' % (action.capitalize(), service_name))
|
||||
return self._daemon_actions(args)
|
||||
|
||||
@forall_hosts
|
||||
def _daemon_actions(self, daemon_type: str, daemon_id: str, host: str, action: str) -> str:
|
||||
with set_exception_subject('daemon', DaemonDescription(
|
||||
daemon_type=daemon_type,
|
||||
daemon_id=daemon_id
|
||||
).name()):
|
||||
return self._daemon_action(daemon_type, daemon_id, host, action)
|
||||
return [
|
||||
self._schedule_daemon_action(dd.name(), action)
|
||||
for dd in dds
|
||||
]
|
||||
|
||||
def _daemon_action(self, daemon_type: str, daemon_id: str, host: str, action: str, image: Optional[str] = None) -> str:
|
||||
daemon_spec: CephadmDaemonSpec = CephadmDaemonSpec(
|
||||
|
Loading…
Reference in New Issue
Block a user