Skip to content

Commit

Permalink
Replace getargspec with getfullargspec (#663) (#666)
Browse files Browse the repository at this point in the history
* Replace getargspec with getfullargspec

Signed-off-by: Martin Nečas <necas.marty@gmail.com>

* Add changelog

Signed-off-by: Martin Perina <mperina@redhat.com>

Signed-off-by: Martin Nečas <necas.marty@gmail.com>
Signed-off-by: Martin Perina <mperina@redhat.com>
Co-authored-by: Martin Perina <mperina@redhat.com>

Signed-off-by: Martin Nečas <necas.marty@gmail.com>
Signed-off-by: Martin Perina <mperina@redhat.com>
Co-authored-by: Martin Nečas <necas.marty@gmail.com>
  • Loading branch information
mwperina and mnecas authored Jan 24, 2023
1 parent 57ad7dc commit a80c1d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- module_utils - replace `getargspec` with `getfullargspec` to support newer python 3.y versions (https://github.com/oVirt/ovirt-ansible-collection/pull/663).
4 changes: 2 additions & 2 deletions plugins/module_utils/ovirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def search_by_attributes(service, list_params=None, **kwargs):
"""
list_params = list_params or {}
# Check if 'list' method support search(look for search parameter):
if 'search' in inspect.getargspec(service.list)[0]:
if 'search' in inspect.getfullargspec(service.list)[0]:
res = service.list(
# There must be double quotes around name, because some oVirt resources it's possible to create then with space in name.
search=' and '.join('{0}="{1}"'.format(k, v) for k, v in kwargs.items()),
Expand Down Expand Up @@ -308,7 +308,7 @@ def search_by_name(service, name, **kwargs):
:return: Entity object returned by Python SDK
"""
# Check if 'list' method support search(look for search parameter):
if 'search' in inspect.getargspec(service.list)[0]:
if 'search' in inspect.getfullargspec(service.list)[0]:
res = service.list(
# There must be double quotes around name, because some oVirt resources it's possible to create then with space in name.
search='name="{name}"'.format(name=name)
Expand Down

0 comments on commit a80c1d7

Please sign in to comment.