From d23a53b7bd092346bf00d8fd66ff81cefc14f839 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 13 Nov 2019 08:53:37 -0600 Subject: [PATCH] mgr/ssh: fix redeploy Signed-off-by: Sage Weil --- src/pybind/mgr/orchestrator.py | 2 +- src/pybind/mgr/ssh/module.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index b5ca06a4378..01985e2d9ac 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -448,7 +448,7 @@ class Orchestrator(object): :param service_id: service daemon instance (usually a short hostname) :rtype: WriteCompletion """ - assert action in ["start", "stop", "reload"] + assert action in ["start", "stop", "reload", "restart", "redeploy"] assert service_name or service_id assert not (service_name and service_id) raise NotImplementedError() diff --git a/src/pybind/mgr/ssh/module.py b/src/pybind/mgr/ssh/module.py index 4e0d6b7b112..2489215b8ea 100644 --- a/src/pybind/mgr/ssh/module.py +++ b/src/pybind/mgr/ssh/module.py @@ -12,6 +12,7 @@ import multiprocessing.pool from mgr_module import MgrModule import orchestrator +from orchestrator import OrchestratorError from . import remotes @@ -579,11 +580,13 @@ class SSHOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): self._service_action, (d.service_type, d.service_instance, d.nodename, action))) if not results: - n = service_name - if n: - n += '-*' - raise OrchestratorError('Unable to find %s.%s%s daemon(s)' % ( - service_type, service_id, n)) + if service_name: + n = service_name + '-*' + else: + n = service_id + raise OrchestratorError( + 'Unable to find %s.%s daemon(s)' % ( + service_type, n)) return SSHWriteCompletion(results) def _service_action(self, service_type, service_id, host, action): -- 2.47.3