mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-08-01 12:24:43 +00:00
Provide own getargspec for roles and modules with Python 3.11
Python 3.11 dropped compat inspect.getargspec. As the roles and modules need to support Python2 and Python3, the code for getargspec has been copied from Python 3.10 and is added as a fallback as soon as getargspec can not be imported from inspect. The copied getargspec is using getfullargspec internally. Fixes: #855 (Python's inspect.getargspec was removed in version 3.11)
This commit is contained in:
@@ -197,7 +197,6 @@ nosssd_files:
|
||||
|
||||
import os
|
||||
import socket
|
||||
import inspect
|
||||
|
||||
try:
|
||||
from ansible.module_utils.six.moves.configparser import RawConfigParser
|
||||
@@ -212,7 +211,7 @@ from ansible.module_utils.ansible_ipa_client import (
|
||||
CLIENT_INSTALL_ERROR, tasks, check_ldap_conf, timeconf, constants,
|
||||
validate_hostname, nssldap_exists, gssapi, remove_file,
|
||||
check_ip_addresses, ipadiscovery, print_port_conf_info,
|
||||
IPA_PYTHON_VERSION
|
||||
IPA_PYTHON_VERSION, getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -344,7 +343,7 @@ def main():
|
||||
|
||||
if options.realm_name:
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(validate_domain_name)
|
||||
argspec = getargspec(validate_domain_name)
|
||||
if "entity" in argspec.args:
|
||||
# NUM_VERSION >= 40690:
|
||||
validate_domain_name(options.realm_name, entity="realm")
|
||||
|
||||
Reference in New Issue
Block a user