From: Sage Weil Date: Wed, 6 Nov 2019 19:27:54 +0000 (-0600) Subject: mgr/ssh: move entity name munging into a helper X-Git-Tag: v15.1.0~578^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=57410709366d6bf49e6fad44cb84811e8019f03f;p=ceph-ci.git mgr/ssh: move entity name munging into a helper Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/ssh/module.py b/src/pybind/mgr/ssh/module.py index 58088bcd2dd..6c73e505a8e 100644 --- a/src/pybind/mgr/ssh/module.py +++ b/src/pybind/mgr/ssh/module.py @@ -69,6 +69,15 @@ except ImportError: # - bring over some of the protections from ceph-deploy that guard against # multiple bootstrapping / initialization +def _name_to_entity_name(name): + """ + Map from service names to ceph entity names (as seen in config) + """ + if name.startswith('rgw.') or name.startswith('rbd-mirror'): + return 'client.' + name + else: + return name + class AsyncCompletion(orchestrator.Completion): def __init__(self, @@ -563,11 +572,9 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator): try: # get container image - if entity.startswith('rgw.') or entity.startswith('rbd-mirror'): - entity = 'client.' + entity ret, image, err = self.mon_command({ 'prefix': 'config get', - 'who': entity, + 'who': _name_to_entity_name(entity), 'key': 'container_image', }) image = image.strip()