mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
commit
3681185a64
@ -70,9 +70,15 @@ Now you can include your ciphers in your pillar data like so:
|
||||
'''
|
||||
|
||||
import re
|
||||
import gnupg
|
||||
try:
|
||||
import gnupg
|
||||
HAS_GPG = True
|
||||
except:
|
||||
HAS_GPG = False
|
||||
import logging
|
||||
|
||||
from salt.exceptions import SaltRenderError
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
GPG_HEADER = re.compile(r'-----BEGIN PGP MESSAGE-----')
|
||||
DEFAULT_GPG_KEYDIR = '/etc/salt/gpgkeys'
|
||||
@ -105,6 +111,8 @@ def decrypt_object(o, gpg):
|
||||
|
||||
|
||||
def render(data, saltenv='base', sls='', argline='', **kwargs):
|
||||
if not HAS_GPG:
|
||||
raise SaltRenderError('GPG unavailable')
|
||||
if isinstance(__salt__, dict):
|
||||
if 'config.get' in __salt__:
|
||||
homedir = __salt__['config.get']('gpg_keydir', DEFAULT_GPG_KEYDIR)
|
||||
|
@ -41,7 +41,9 @@ if HAS_PIP is True:
|
||||
HAS_PIP = False
|
||||
# Remove references to the loaded pip module above so reloading works
|
||||
import sys
|
||||
del pip, sys.modules['pip']
|
||||
del pip
|
||||
if 'pip' in sys.modules:
|
||||
del sys.modules['pip']
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -18,7 +18,9 @@ def __virtual__():
|
||||
Load this state if this is the salt-master
|
||||
'''
|
||||
|
||||
return 'winrepo' if 'salt-master' in __grains__['roles'] else False
|
||||
return ('winrepo'
|
||||
if 'salt-master' in __grains__.get('roles', [])
|
||||
else False)
|
||||
|
||||
|
||||
def genrepo(name, force=False, allow_empty=False):
|
||||
|
Loading…
Reference in New Issue
Block a user