Merge pull request #10183 from tedski/10107_fix

Check for missing deps before attempting to install.
This commit is contained in:
Thomas S Hatch 2014-02-04 19:41:51 -08:00
commit ea4bc80549

View File

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