summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/APT.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Client/Tools/APT.py')
-rw-r--r--src/lib/Client/Tools/APT.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index fe1ef6fdd..d7be44dc0 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -9,6 +9,8 @@ warnings.filterwarnings("ignore", "Accessed deprecated property Package.installe
warnings.filterwarnings("ignore", "Accessed deprecated property Package.candidateVersion, please see the Version class for alternatives.", DeprecationWarning)
warnings.filterwarnings("ignore", "Deprecated, please use 'is_installed' instead", DeprecationWarning)
warnings.filterwarnings("ignore", "Attribute 'IsUpgradable' of the 'apt_pkg.DepCache' object is deprecated, use 'is_upgradable' instead.", DeprecationWarning)
+warnings.filterwarnings("ignore", "Attribute 'VersionList' of the 'apt_pkg.Package' object is deprecated, use 'version_list' instead.", DeprecationWarning)
+warnings.filterwarnings("ignore", "Attribute 'VerStr' of the 'apt_pkg.Version' object is deprecated, use 'ver_str' instead.", DeprecationWarning)
import apt.cache
import os
@@ -69,7 +71,11 @@ class APT(Bcfg2.Client.Tools.Tool):
if self.setup['kevlar'] and not self.setup['dryrun']:
self.cmd.run("%s --force-confold --configure --pending" % DPKG)
self.cmd.run("%s clean" % APTGET)
- self.pkg_cache = apt.cache.Cache()
+ try:
+ self.pkg_cache = apt.cache.Cache()
+ except SystemError, e:
+ self.logger.info("Failed to initialize APT cache: %s" % e)
+ raise Bcfg2.Client.Tools.toolInstantiationError
self.pkg_cache.update()
self.pkg_cache = apt.cache.Cache()