diff options
author | likui <likui@yovole.com> | 2021-05-10 18:10:56 +0800 |
---|---|---|
committer | likui <likui@yovole.com> | 2021-05-12 10:50:52 +0800 |
commit | 150b9182512fa0a4f157586e040a7f67c1851005 (patch) | |
tree | d39766c26fb64fd1eb71716fe5e360ae353d874c /nova/utils.py | |
parent | 7953c0197d1a4466cb5b78070d47626c92f9db6e (diff) | |
download | nova-150b9182512fa0a4f157586e040a7f67c1851005.tar.gz |
Replace getargspec with getfullargspec
inspect.getargspec() is deprecated since py3
[1] https://docs.python.org/3/library/inspect.html#inspect.getargspec
Change-Id: I6fbdf942dd192351e135430997c15ea92e7fb8af
Diffstat (limited to 'nova/utils.py')
-rw-r--r-- | nova/utils.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/nova/utils.py b/nova/utils.py index 5239dd4ba8..c1b4fccc47 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -80,12 +80,6 @@ _FILE_CACHE = {} _SERVICE_TYPES = service_types.ServiceTypes() -if hasattr(inspect, 'getfullargspec'): - getargspec = inspect.getfullargspec -else: - getargspec = inspect.getargspec - - # NOTE(mikal): this seems to have to stay for now to handle os-brick # requirements. This makes me a sad panda. def get_root_helper(): @@ -553,7 +547,7 @@ def expects_func_args(*args): @functools.wraps(dec) def _decorator(f): base_f = safe_utils.get_wrapped_function(f) - argspec = getargspec(base_f) + argspec = inspect.getfullargspec(base_f) if argspec[1] or argspec[2] or set(args) <= set(argspec[0]): # NOTE (ndipanov): We can't really tell if correct stuff will # be passed if it's a function with *args or **kwargs so |