Skip to content

Commit

Permalink
mgr/cephadm: set docstring for shim() methods
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tchaikov committed Mar 6, 2022
1 parent 0a5fab5 commit d0db2ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pybind/mgr/orchestrator/_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

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
Expand Down Expand Up @@ -1424,9 +1424,10 @@ def inner(self: Any, *args: Any, **kwargs: 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


Expand Down

0 comments on commit d0db2ae

Please sign in to comment.