Merge pull request #12385 from makinacorpus/ff

Ff
This commit is contained in:
Thomas S Hatch 2014-04-29 22:18:50 -06:00
commit 3681185a64
3 changed files with 15 additions and 3 deletions

View File

@ -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)

View File

@ -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__)

View File

@ -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):