From: Kefu Chai Date: Sun, 6 Mar 2022 06:05:07 +0000 (+0800) Subject: mgr/cephadm: set docstring for shim() methods X-Git-Tag: v17.2.0~5^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fd3aba02902da15d09016678fce01f48e13be085;p=ceph.git 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) --- diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 8fb45273631f..02c43443dcb0 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