diff options
-rw-r--r-- | src/lib/Client/Tools/APT.py | 7 | ||||
-rw-r--r-- | src/lib/Client/Tools/RPM.py | 2 | ||||
-rw-r--r-- | src/lib/Client/Tools/__init__.py | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py index f78cd9cbd..b6b09d1b3 100644 --- a/src/lib/Client/Tools/APT.py +++ b/src/lib/Client/Tools/APT.py @@ -1,9 +1,14 @@ '''This is the bcfg2 support for apt-get''' __revision__ = '$Revision$' -import apt_pkg, os, re +import os, re import Bcfg2.Client.Tools +try: + import apt_pkg +except ImportError: + raise toolInstantiationError + class APT(Bcfg2.Client.Tools.PkgTool): '''The Debian toolset implements package and service operations and inherits the rest from Toolset.Toolset''' diff --git a/src/lib/Client/Tools/RPM.py b/src/lib/Client/Tools/RPM.py index 661c0a167..3a3d1b7e4 100644 --- a/src/lib/Client/Tools/RPM.py +++ b/src/lib/Client/Tools/RPM.py @@ -23,6 +23,8 @@ class RPM(Bcfg2.Client.Tools.PkgTool): (name, version) = line.split() self.installed[name] = version except ValueError: + if line == '': + continue self.logger.error("Failed to access RPM db; retrying after 30s") time.sleep(30) return self.RefreshPackages(level + 1) diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py index da9f47eeb..c415493ab 100644 --- a/src/lib/Client/Tools/__init__.py +++ b/src/lib/Client/Tools/__init__.py @@ -171,6 +171,7 @@ class PkgTool(Tool): self.installed = {} self.Remove = self.RemovePackages self.FindExtra = self.FindExtraPackages + self.RefreshPackages() def VerifyPackage(self, dummy, _): '''Dummy verification method''' |