mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
recreate cert on bad password
This commit is contained in:
parent
6497094ba7
commit
403000d375
1 changed files with 5 additions and 1 deletions
|
@ -168,6 +168,10 @@ import salt.utils
|
|||
# Import 3rd-party libs
|
||||
import salt.ext.six as six
|
||||
|
||||
try:
|
||||
from M2Crypto.RSA import RSAError
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
|
@ -227,7 +231,7 @@ def _check_private_key(name, bits=2048, passphrase=None, new=False):
|
|||
try:
|
||||
current_bits = __salt__['x509.get_private_key_size'](
|
||||
private_key=name, passphrase=passphrase)
|
||||
except salt.exceptions.SaltInvocationError:
|
||||
except (salt.exceptions.SaltInvocationError, RSAError):
|
||||
pass
|
||||
|
||||
return current_bits == bits and not new
|
||||
|
|
Loading…
Add table
Reference in a new issue