mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #8155 from malinoff/fix-gpgkey-fail
Fix apt-key silently fails
This commit is contained in:
commit
6cf66d8d0c
@ -1139,18 +1139,12 @@ def mod_repo(repo, **kwargs):
|
||||
if not imported:
|
||||
cmd = ('apt-key adv --keyserver {0} --logger-fd 1 '
|
||||
'--recv-keys {1}')
|
||||
out = __salt__['cmd.run_stdout'](cmd.format(ks, keyid),
|
||||
ret= __salt__['cmd.run_all'](cmd.format(ks, keyid),
|
||||
**kwargs)
|
||||
if not (out.find('imported') or out.find('not changed')):
|
||||
if ret['retcode'] != 0:
|
||||
error_str = 'Error: key retrieval failed: {0}'
|
||||
raise Exception(
|
||||
error_str.format(
|
||||
cmd.format(
|
||||
ks,
|
||||
keyid
|
||||
)
|
||||
)
|
||||
)
|
||||
raise Exception(error_str.format(ret['stdout']))
|
||||
|
||||
elif 'key_url' in kwargs:
|
||||
key_url = kwargs['key_url']
|
||||
fn_ = __salt__['cp.cache_file'](key_url)
|
||||
|
@ -718,7 +718,8 @@ def retcode(cmd,
|
||||
umask=None,
|
||||
quiet=False,
|
||||
timeout=None,
|
||||
reset_system_locale=True):
|
||||
reset_system_locale=True,
|
||||
**kwargs):
|
||||
'''
|
||||
Execute a shell command and return the command's return code.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user