mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fixing unit tests.
This commit is contained in:
parent
80c24be4fe
commit
55eb73b0c9
2 changed files with 8 additions and 3 deletions
|
@ -210,7 +210,6 @@ def list_keys(user=None):
|
|||
salt '*' gpg.list_keys
|
||||
|
||||
'''
|
||||
log.debug('GPG_1_3_1 {0}'.format(GPG_1_3_1))
|
||||
_keys = []
|
||||
for _key in _list_keys(user):
|
||||
tmp = {}
|
||||
|
@ -611,6 +610,12 @@ def import_key(user=None,
|
|||
raise SaltInvocationError('filename does not exist.')
|
||||
|
||||
imported_data = gpg.import_keys(text)
|
||||
|
||||
# include another check for Salt unit tests
|
||||
gnupg_version = distutils.version.LooseVersion(gnupg.__version__)
|
||||
if gnupg_version >= '1.3.1':
|
||||
GPG_1_3_1 = True
|
||||
|
||||
if GPG_1_3_1:
|
||||
counts = imported_data.counts
|
||||
if counts.get('imported') or counts.get('imported_rsa'):
|
||||
|
|
|
@ -37,7 +37,7 @@ RET = [{'created': '2014-07-25',
|
|||
|
||||
class Mockgnupg(object):
|
||||
'''
|
||||
Mock smtplib class
|
||||
Mock gnupg class
|
||||
'''
|
||||
__version__ = '1.3.1'
|
||||
fingerprint = u'F321F'
|
||||
|
@ -50,7 +50,7 @@ class Mockgnupg(object):
|
|||
|
||||
class GPG(object):
|
||||
'''
|
||||
Mock smtplib class
|
||||
Mock gnupg class
|
||||
'''
|
||||
def __init__(self, gnupghome='/tmp/salt/.gnupg',
|
||||
homedir='/tmp/salt/.gnupg'):
|
||||
|
|
Loading…
Add table
Reference in a new issue