From fd3aba02902da15d09016678fce01f48e13be085 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 6 Mar 2022 14:05:07 +0800 Subject: [PATCH] mgr/cephadm: set docstring for shim() methods this allows the "rpc"ized methods of OrchestratorClientMixin to have the docstring defined by the original methods. Signed-off-by: Kefu Chai (cherry picked from commit d0db2ae4f946e1a985402640ef8f1733b40e91ef) --- src/pybind/mgr/orchestrator/_interface.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 8fb45273631ff..02c43443dcb01 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -15,7 +15,7 @@ import re from collections import namedtuple, OrderedDict from contextlib import contextmanager -from functools import wraps, reduce +from functools import wraps, reduce, update_wrapper from typing import TypeVar, Generic, List, Optional, Union, Tuple, Iterator, Callable, Any, \ Sequence, Dict, cast, Mapping @@ -1424,9 +1424,10 @@ def _mk_orch_methods(cls: Any) -> Any: return completion return inner - for meth in Orchestrator.__dict__: - if not meth.startswith('_') and meth not in ['is_orchestrator_module']: - setattr(cls, meth, shim(meth)) + for name, method in Orchestrator.__dict__.items(): + if not name.startswith('_') and name not in ['is_orchestrator_module']: + remote_call = update_wrapper(shim(name), method) + setattr(cls, name, remote_call) return cls -- 2.39.5