]> 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)
committerLaura Flores <lflores@redhat.com>
Mon, 25 Apr 2022 17:43:31 +0000 (12:43 -0500)
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>
(cherry picked from commit d0db2ae4f946e1a985402640ef8f1733b40e91ef)

 Conflicts:
src/pybind/mgr/orchestrator/_interface.py
- Removed some typing imports that were not present
  in Octopus

src/pybind/mgr/orchestrator/_interface.py

index c22ac4c2d3fefe038cfb9d03b25de13665875ca1..2780b00cf7421ee6682e4d22755147a191fea2f3 100644 (file)
@@ -16,7 +16,7 @@ import uuid
 
 from collections import namedtuple, OrderedDict
 from contextlib import contextmanager
-from functools import wraps
+from functools import wraps, update_wrapper
 
 import yaml
 
@@ -1630,9 +1630,10 @@ def _mk_orch_methods(cls):
             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