mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 21:33:00 +00:00
Remove dependency on ansible.netcommon collection (#2)
* Get rid of ansible.netcommon requirement by integrating module_utils/compat/ipaddress.py. * Reorder imports. * Update ignore.txt for plugins/module_utils/compat/ipaddress.py. * Linting (flake8 / pep8). * Remove accidentally commited test for ansible/ansible#66920.
This commit is contained in:
@@ -29,10 +29,11 @@ import tempfile
|
||||
import traceback
|
||||
|
||||
from ansible.module_utils.basic import missing_required_lib
|
||||
from ansible.module_utils._text import to_native, to_text, to_bytes
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
from ansible_collections.ansible.netcommon.plugins.module_utils.compat import ipaddress as compat_ipaddress
|
||||
from ansible.module_utils.six.moves.urllib.parse import unquote
|
||||
from ansible.module_utils._text import to_native, to_text, to_bytes
|
||||
|
||||
from ansible_collections.community.crypto.plugins.module_utils.compat import ipaddress as compat_ipaddress
|
||||
|
||||
try:
|
||||
import cryptography
|
||||
|
||||
2578
plugins/module_utils/compat/ipaddress.py
Normal file
2578
plugins/module_utils/compat/ipaddress.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -30,9 +30,22 @@ from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
import abc
|
||||
import base64
|
||||
import binascii
|
||||
import datetime
|
||||
import errno
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
from ansible.module_utils import six
|
||||
from ansible.module_utils._text import to_native, to_bytes, to_text
|
||||
|
||||
try:
|
||||
import OpenSSL
|
||||
from OpenSSL import crypto
|
||||
@@ -120,20 +133,6 @@ except ImportError:
|
||||
HAS_CRYPTOGRAPHY = False
|
||||
|
||||
|
||||
import abc
|
||||
import base64
|
||||
import binascii
|
||||
import datetime
|
||||
import errno
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
import tempfile
|
||||
|
||||
from ansible.module_utils import six
|
||||
from ansible.module_utils._text import to_native, to_bytes, to_text
|
||||
|
||||
|
||||
class OpenSSLObjectError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user