diff options
author | Riccardo Pittau <elfosardo@gmail.com> | 2020-07-01 17:25:09 +0200 |
---|---|---|
committer | Riccardo Pittau <elfosardo@gmail.com> | 2020-07-01 17:25:09 +0200 |
commit | 498ab5224b151355dd29bb2f1df7e9c574696321 (patch) | |
tree | 172ddecedd7cc0dce6dbaf2f92e01ca794d5d3bd /ironic/api | |
parent | 57b619bf804d9ccdc1d84356de53476689148150 (diff) | |
download | ironic-498ab5224b151355dd29bb2f1df7e9c574696321.tar.gz |
Use getfullargspec to inspect functions
The getfullargspec [1] function is maintained to provide compatibility
with the deprecatad getargspec [2].
[1] https://docs.python.org/3/library/inspect.html#inspect.getfullargspec
[2] https://docs.python.org/3/library/inspect.html#inspect.getargspec
Change-Id: Ibf78672c15702af43ed2ee1256517b1a1a895120
Diffstat (limited to 'ironic/api')
-rw-r--r-- | ironic/api/expose.py | 2 | ||||
-rw-r--r-- | ironic/api/functions.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ironic/api/expose.py b/ironic/api/expose.py index 94c0e8d76..71bfa1500 100644 --- a/ironic/api/expose.py +++ b/ironic/api/expose.py @@ -123,7 +123,7 @@ def expose(*args, **kwargs): ) pecan_json_decorate(callfunction) - pecan.util._cfg(callfunction)['argspec'] = inspect.getargspec(f) + pecan.util._cfg(callfunction)['argspec'] = inspect.getfullargspec(f) callfunction._wsme_definition = funcdef return callfunction diff --git a/ironic/api/functions.py b/ironic/api/functions.py index 8b4cebbdd..8554bd7e4 100644 --- a/ironic/api/functions.py +++ b/ironic/api/functions.py @@ -37,7 +37,8 @@ def wrapfunc(f): def getargspec(f): f = getattr(f, '_wsme_original_func', f) - return inspect.getargspec(f) + func_argspec = inspect.getfullargspec(f) + return func_argspec[0:4] class FunctionArgument(object): |