summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-07-21 18:35:36 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-07-21 18:35:36 +0000
commit81cc9e874928ee97283cbf501b4ffd3917f1f476 (patch)
tree8944c92ddf54887708a25eab86f0e6b4c00a4944 /src
parent8bafcbe5ff404e71c1c540dd9794ab4a461e5f14 (diff)
downloadbcfg2-81cc9e874928ee97283cbf501b4ffd3917f1f476.tar.gz
bcfg2-81cc9e874928ee97283cbf501b4ffd3917f1f476.tar.bz2
bcfg2-81cc9e874928ee97283cbf501b4ffd3917f1f476.zip
APT: add backwards compatibility for python-apt 0.6
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5375 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Tools/APT.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index 2148a3207..074b9f1ca 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -132,8 +132,15 @@ class APT(Bcfg2.Client.Tools.Tool):
self.logger.info('Removing packages:')
self.logger.info(pkgnames)
for pkg in pkgnames.split(" "):
- self.pkg_cache[pkg].markDelete(purge=True)
- self.pkg_cache.commit()
+ try:
+ self.pkg_cache[pkg].markDelete(purge=True)
+ except:
+ self.pkg_cache[pkg].markDelete()
+ try:
+ self.pkg_cache.commit()
+ except SystemExit:
+ # thank you python-apt 0.6
+ pass
self.pkg_cache = apt.cache.Cache()
self.modified += packages
self.extra = self.FindExtra()