]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: set docstring for shim() methods
authorKefu Chai <tchaikov@gmail.com>
Sun, 6 Mar 2022 06:05:07 +0000 (14:05 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sun, 6 Mar 2022 06:15:23 +0000 (14:15 +0800)
this allows the "rpc"ized methods of OrchestratorClientMixin to
have the docstring defined by the original methods.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/pybind/mgr/orchestrator/_interface.py

index 344dea13854e8f08038baf4d8a4cff791648e46c..91a5893281180917d1793dfa2de4f68a61934431 100644 (file)
@@ -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