mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
aptpkg.mod_repo: Raise when key_url doesn't exist
_cmd_quote would raise with unexplicit error if _fn = False
This commit is contained in:
parent
843c28b435
commit
d9787aa318
1 changed files with 4 additions and 0 deletions
|
@ -1597,6 +1597,10 @@ def mod_repo(repo, saltenv='base', **kwargs):
|
|||
elif 'key_url' in kwargs:
|
||||
key_url = kwargs['key_url']
|
||||
fn_ = __salt__['cp.cache_file'](key_url, saltenv)
|
||||
if not fn_:
|
||||
raise CommandExecutionError(
|
||||
'Error: file not found: {0}'.format(key_url)
|
||||
)
|
||||
cmd = 'apt-key add {0}'.format(_cmd_quote(fn_))
|
||||
out = __salt__['cmd.run_stdout'](cmd, **kwargs)
|
||||
if not out.upper().startswith('OK'):
|
||||
|
|
Loading…
Add table
Reference in a new issue