mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #10183 from tedski/10107_fix
Check for missing deps before attempting to install.
This commit is contained in:
commit
ea4bc80549
@ -1556,16 +1556,18 @@ def _resolve_deps(name, pkgs, **kwargs):
|
||||
deb = apt.debfile.DebPackage(filename=pkg_file)
|
||||
if deb.check():
|
||||
missing_deps.extend(deb.missing_deps)
|
||||
|
||||
if missing_deps:
|
||||
cmd = ['apt-get', '-q', '-y']
|
||||
cmd = cmd + ['-o', 'DPkg::Options::=--force-confold']
|
||||
cmd = cmd + ['-o', 'DPkg::Options::=--force-confdef']
|
||||
cmd.append('install')
|
||||
cmd.extend(missing_deps)
|
||||
|
||||
ret = __salt__['cmd.run'](cmd, env=kwargs.get('env'), python_shell=False,
|
||||
ret = __salt__['cmd.retcode'](cmd, env=kwargs.get('env'), python_shell=False,
|
||||
output_loglevel='debug')
|
||||
|
||||
if ret['retcode'] != 0:
|
||||
if ret != 0:
|
||||
raise CommandExecutionError(
|
||||
'Error: unable to resolve dependencies for: {0}'.format(name)
|
||||
)
|
||||
@ -1576,5 +1578,4 @@ def _resolve_deps(name, pkgs, **kwargs):
|
||||
output_loglevel='debug')
|
||||
except MinionError as exc:
|
||||
raise CommandExecutionError(exc)
|
||||
|
||||
return
|
Loading…
Reference in New Issue
Block a user