mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 13:22:58 +00:00
Adjust to new pylint release.
This commit is contained in:
@@ -174,12 +174,12 @@ except ImportError:
|
||||
UnsupportedAlgorithm = Exception # type: ignore
|
||||
CryptographyInternalError = Exception # type: ignore
|
||||
HAS_CRYPTOGRAPHY = False
|
||||
CRYPTOGRAPHY_VERSION = None
|
||||
CRYPTOGRAPHY_IMP_ERR = traceback.format_exc()
|
||||
CRYPTOGRAPHY_VERSION = None # pylint: disable=invalid-name
|
||||
CRYPTOGRAPHY_IMP_ERR = traceback.format_exc() # pylint: disable=invalid-name
|
||||
else:
|
||||
HAS_CRYPTOGRAPHY = True
|
||||
CRYPTOGRAPHY_VERSION = cryptography.__version__
|
||||
CRYPTOGRAPHY_IMP_ERR = None
|
||||
CRYPTOGRAPHY_VERSION = cryptography.__version__ # pylint: disable=invalid-name
|
||||
CRYPTOGRAPHY_IMP_ERR = None # pylint: disable=invalid-name
|
||||
|
||||
|
||||
CURVES = (
|
||||
|
||||
@@ -318,7 +318,7 @@ try:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
CRYPTOGRAPHY_COMPATIBILITY2022_ERR = None
|
||||
CRYPTOGRAPHY_COMPATIBILITY2022_ERR: str | None
|
||||
try:
|
||||
import cryptography.x509
|
||||
from cryptography.hazmat.primitives import hashes
|
||||
@@ -329,9 +329,11 @@ try:
|
||||
PBES.PBESv1SHA1And3KeyTripleDESCBC
|
||||
).hmac_hash(hashes.SHA1())
|
||||
except Exception:
|
||||
# pylint: disable-next=invalid-name
|
||||
CRYPTOGRAPHY_COMPATIBILITY2022_ERR = traceback.format_exc()
|
||||
CRYPTOGRAPHY_HAS_COMPATIBILITY2022 = False
|
||||
else:
|
||||
CRYPTOGRAPHY_COMPATIBILITY2022_ERR = None # pylint: disable=invalid-name
|
||||
CRYPTOGRAPHY_HAS_COMPATIBILITY2022 = True
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
|
||||
@@ -117,9 +117,11 @@ try:
|
||||
import cryptography.hazmat.primitives.asymmetric.padding
|
||||
import cryptography.hazmat.primitives.hashes
|
||||
|
||||
CRYPTOGRAPHY_VERSION = LooseVersion(cryptography.__version__)
|
||||
except ImportError:
|
||||
CRYPTOGRAPHY_VERSION = LooseVersion("0.0")
|
||||
CRYPTOGRAPHY_VERSION = LooseVersion("0.0") # pylint: disable=invalid-name
|
||||
else:
|
||||
# pylint: disable-next=invalid-name
|
||||
CRYPTOGRAPHY_VERSION = LooseVersion(cryptography.__version__)
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
@@ -106,9 +106,11 @@ try:
|
||||
import cryptography.hazmat.primitives.asymmetric.padding
|
||||
import cryptography.hazmat.primitives.hashes
|
||||
|
||||
CRYPTOGRAPHY_VERSION = LooseVersion(cryptography.__version__)
|
||||
except ImportError:
|
||||
CRYPTOGRAPHY_VERSION = LooseVersion("0.0")
|
||||
CRYPTOGRAPHY_VERSION = LooseVersion("0.0") # pylint: disable=invalid-name
|
||||
else:
|
||||
# pylint: disable-next=invalid-name
|
||||
CRYPTOGRAPHY_VERSION = LooseVersion(cryptography.__version__)
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
Reference in New Issue
Block a user