mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-08-01 04:14:42 +00:00
workaround 2.9 controller import issues
* prevents failures on Ansible 2.9 during module build due to https://github.com/ansible/ansible/issues/68361 * fixes https://github.com/freeipa/ansible-freeipa/issues/315
This commit is contained in:
@@ -22,7 +22,19 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ["gssapi", "netaddr", "api", "ipalib_errors", "Env",
|
||||||
|
"DEFAULT_CONFIG", "LDAP_GENERALIZED_TIME_FORMAT",
|
||||||
|
"kinit_password", "kinit_keytab", "run", "DN", "VERSION",
|
||||||
|
"paths", "get_credentials_if_valid", "Encoding",
|
||||||
|
"load_pem_x509_certificate"]
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# HACK: workaround for Ansible 2.9 https://github.com/ansible/ansible/issues/68361
|
||||||
|
if 'ansible.executor' in sys.modules:
|
||||||
|
for attr in __all__:
|
||||||
|
setattr(sys.modules[__name__], attr, None)
|
||||||
|
else:
|
||||||
import operator
|
import operator
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|||||||
@@ -45,6 +45,14 @@ __all__ = ["gssapi", "version", "ipadiscovery", "api", "errors", "x509",
|
|||||||
"configure_firefox", "sync_time", "check_ldap_conf",
|
"configure_firefox", "sync_time", "check_ldap_conf",
|
||||||
"sssd_enable_ifp"]
|
"sssd_enable_ifp"]
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# HACK: workaround for Ansible 2.9 https://github.com/ansible/ansible/issues/68361
|
||||||
|
if 'ansible.executor' in sys.modules:
|
||||||
|
for attr in __all__:
|
||||||
|
setattr(sys.modules[__name__], attr, None)
|
||||||
|
|
||||||
|
else:
|
||||||
from ipapython.version import NUM_VERSION, VERSION
|
from ipapython.version import NUM_VERSION, VERSION
|
||||||
|
|
||||||
if NUM_VERSION < 30201:
|
if NUM_VERSION < 30201:
|
||||||
|
|||||||
@@ -46,6 +46,12 @@ __all__ = ["contextlib", "dnsexception", "dnsresolver", "dnsreversename",
|
|||||||
"dnsname", "kernel_keyring", "krbinstance"]
|
"dnsname", "kernel_keyring", "krbinstance"]
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# HACK: workaround for Ansible 2.9 https://github.com/ansible/ansible/issues/68361
|
||||||
|
if 'ansible.executor' in sys.modules:
|
||||||
|
for attr in __all__:
|
||||||
|
setattr(sys.modules[__name__], attr, None)
|
||||||
|
else:
|
||||||
import logging
|
import logging
|
||||||
from contextlib import contextmanager as contextlib_contextmanager
|
from contextlib import contextmanager as contextlib_contextmanager
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,14 @@ __all__ = ["IPAChangeConf", "certmonger", "sysrestore", "root_logger",
|
|||||||
"check_available_memory"]
|
"check_available_memory"]
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# HACK: workaround for Ansible 2.9 https://github.com/ansible/ansible/issues/68361
|
||||||
|
if 'ansible.executor' in sys.modules:
|
||||||
|
for attr in __all__:
|
||||||
|
setattr(sys.modules[__name__], attr, None)
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from contextlib import contextmanager as contextlib_contextmanager
|
from contextlib import contextmanager as contextlib_contextmanager
|
||||||
import six
|
import six
|
||||||
|
|||||||
Reference in New Issue
Block a user