mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
parent
06e67d25f8
commit
6bf2ee2751
2 changed files with 13 additions and 1 deletions
|
@ -63,10 +63,13 @@ CERT_DEFAULTS = {'days_valid': 365, 'version': 3, 'serial_bits': 64, 'algorithm'
|
|||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
only load this module if m2crypto is available
|
||||
'''
|
||||
if HAS_M2:
|
||||
return __virtualname__
|
||||
else:
|
||||
return False
|
||||
return (False, 'Could not load x509 module, m2crypto unavailable')
|
||||
|
||||
|
||||
class _Ctx(ctypes.Structure):
|
||||
|
|
|
@ -168,6 +168,15 @@ import salt.utils
|
|||
# Import 3rd-party libs
|
||||
import salt.ext.six as six
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
only load this module if the corresponding execution module is loaded
|
||||
'''
|
||||
if 'x509.get_pem_entry' in __salt__:
|
||||
return 'x509'
|
||||
else:
|
||||
return (False, 'Could not load x509 state: m2crypto unavailable')
|
||||
|
||||
|
||||
def _revoked_to_list(revs):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue