Skip to content

Commit

Permalink
Prevent crash if PyOpenSSL cannot be imported because of an Attribute…
Browse files Browse the repository at this point in the history
…Error.
  • Loading branch information
felixfontein committed Apr 26, 2022
1 parent 9b2199f commit 3ee18d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/module_utils/crypto/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
try:
from OpenSSL import crypto
HAS_PYOPENSSL = True
except ImportError:
except (ImportError, AttributeError):
# Error handled in the calling module.
HAS_PYOPENSSL = False

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/openssl_pkcs12.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
import OpenSSL
from OpenSSL import crypto
PYOPENSSL_VERSION = LooseVersion(OpenSSL.__version__)
except ImportError:
except (ImportError, AttributeError):
PYOPENSSL_IMP_ERR = traceback.format_exc()
PYOPENSSL_FOUND = False
else:
Expand Down

0 comments on commit 3ee18d2

Please sign in to comment.