summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-12-10 17:17:54 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-12-10 17:17:54 +0000
commit5d4d6152298f85ae36e775351a26a0bd9bdd52b3 (patch)
tree126c5463bf8e5eb0ec5f17456e8499ea1ebefdb0 /src/lib/Client
parent2dd81e93aa03a3c974ce492cb07458ea9417e3b8 (diff)
downloadbcfg2-5d4d6152298f85ae36e775351a26a0bd9bdd52b3.tar.gz
bcfg2-5d4d6152298f85ae36e775351a26a0bd9bdd52b3.tar.bz2
bcfg2-5d4d6152298f85ae36e775351a26a0bd9bdd52b3.zip
Merge branch 'tools'
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4992 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Tools/APT.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index 82819c564..1acd70cae 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -138,6 +138,7 @@ class APT(Bcfg2.Client.Tools.Tool):
# it looks like you can't install arbitrary versions of software
# out of the pkg cache, we will still need to call apt-get
ipkgs = []
+ bad_pkgs = []
for pkg in packages:
if not self.pkg_cache.has_key(pkg.get('name')):
self.logger.error("APT has no information about package %s" % (pkg.get('name')))
@@ -149,6 +150,13 @@ class APT(Bcfg2.Client.Tools.Tool):
if pkg.get('version') in \
[p.VerStr for p in self.pkg_cache[pkg.get('name')]._pkg.VersionList]:
ipkgs.append("%s=%s" % (pkg.get('name'), pkg.get('version')))
+ continue
+ bad_pkgs.append(pkg.get('name'))
+ if bad_pkgs:
+ self.logger.error("Cannot find correct versions of packages:")
+ self.logger.error(bad_pkgs)
+ if not ipkgs:
+ return
rc = self.cmd.run(self.pkgcmd % (" ".join(ipkgs)))[0]
if rc:
self.logger.error("APT command failed")