diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2010-10-28 14:20:15 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-11-02 20:35:19 -0500 |
commit | 3e55068024caf55f0ed287e878c22aa71ff5ecfd (patch) | |
tree | 8f32755a7b05e854411ee463d33c1c671f5fd979 /src | |
parent | 600cb7c95e62f523df492d086734fcf74bb1ca6b (diff) | |
download | bcfg2-3e55068024caf55f0ed287e878c22aa71ff5ecfd.tar.gz bcfg2-3e55068024caf55f0ed287e878c22aa71ff5ecfd.tar.bz2 bcfg2-3e55068024caf55f0ed287e878c22aa71ff5ecfd.zip |
Pacman: Use logging infrastructure for printing messages
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Client/Tools/Pacman.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/lib/Client/Tools/Pacman.py b/src/lib/Client/Tools/Pacman.py index a9edc4d65..85068ddfc 100644 --- a/src/lib/Client/Tools/Pacman.py +++ b/src/lib/Client/Tools/Pacman.py @@ -1,8 +1,7 @@ """This is the bcfg2 support for pacman""" import Bcfg2.Client.Tools -import Bcfg2.Options -import Bcfg2.Client.Tools + class Pacman(Bcfg2.Client.Tools.PkgTool): '''Archlinux package support''' @@ -31,7 +30,8 @@ class Pacman(Bcfg2.Client.Tools.PkgTool): def VerifyPackage(self, entry, modlist): '''Verify Package status for entry''' - print "VerifyPackage : " + entry.get('name')+ " : " + entry.get('version') + self.logger.info("VerifyPackage : %s : %s" % entry.get('name'), + entry.get('version')) if not 'version' in entry.attrib: self.logger.info("Cannot verify unversioned package %s" % @@ -44,8 +44,8 @@ class Pacman(Bcfg2.Client.Tools.PkgTool): elif self.installed[entry.attrib['name']] == entry.attrib['version']: #if not self.setup['quick'] and \ # entry.get('verify', 'true') == 'true': - #FIXME: We should be able to check this once - # http://trac.macports.org/ticket/15709 is implemented + #FIXME: need to figure out if pacman + # allows you to verify packages return True else: entry.set('current_version', self.installed[entry.get('name')]) @@ -76,11 +76,7 @@ class Pacman(Bcfg2.Client.Tools.PkgTool): print "packages : " + pkgline try: - self.logger.debug('Running Pacman.Install()') - print "running : %s -S %s" % (self.pkgtool, pkgline) - s = self.cmd.run("%s -S %s" % (self.pkgtool, pkgline)) - print "pacman : " + str(s) - except Exception as ex: - print "error in cmd.run ", ex - - self.logger.debug('Running Pacman.Install()') + self.logger.debug("Running : %s -S %s" % (self.pkgtool, pkgline)) + self.cmd.run("%s -S %s" % (self.pkgtool, pkgline)) + except Exception as e: + self.logger.error("Error occurred during installation: %s" % e) |