From 97fb0411763063d5f6163618e5aab2f3700f630f Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sat, 25 Jul 2015 03:38:52 +0200 Subject: Fix errros with old pylint/pep8 For Python2.4 we need older version of pylint and pep8, that finds some more errors: - On python2.4 _ast is not available and pylint uses compiler.ast, that seems to have some problems with the line numbers if a comment is following the pylint disable marker. - In python2.4 there is no xml.etree. But we can ignore this error because Client.XML tries to find a suitable library. - Some small formatting issues. --- src/lib/Bcfg2/Client/Tools/APT.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/lib/Bcfg2/Client/Tools/APT.py') diff --git a/src/lib/Bcfg2/Client/Tools/APT.py b/src/lib/Bcfg2/Client/Tools/APT.py index 9b3dded99..4350f6067 100644 --- a/src/lib/Bcfg2/Client/Tools/APT.py +++ b/src/lib/Bcfg2/Client/Tools/APT.py @@ -42,10 +42,10 @@ class APT(Bcfg2.Client.Tools.Tool): if reqdir not in path_entries: os.environ['PATH'] = os.environ['PATH'] + ':' + reqdir self.pkgcmd = '%s ' % self.aptget + \ - '-o DPkg::Options::=--force-confold ' + \ - '-o DPkg::Options::=--force-confmiss ' + \ - '--reinstall ' + \ - '--force-yes ' + '-o DPkg::Options::=--force-confold ' + \ + '-o DPkg::Options::=--force-confmiss ' + \ + '--reinstall ' + \ + '--force-yes ' if not Bcfg2.Options.setup.debug: self.pkgcmd += '-q=2 ' self.pkgcmd += '-y install %s' @@ -158,8 +158,8 @@ class APT(Bcfg2.Client.Tools.Tool): (entry.attrib['name'])) return False pkgname = entry.get('name') - if pkgname not in self.pkg_cache or \ - not self.pkg_cache[pkgname].is_installed: + if (pkgname not in self.pkg_cache or + not self.pkg_cache[pkgname].is_installed): self.logger.info("Package %s not installed" % (entry.get('name'))) entry.set('current_exists', 'false') return False @@ -183,9 +183,9 @@ class APT(Bcfg2.Client.Tools.Tool): return False else: # version matches - if not Bcfg2.Options.setup.quick \ - and entry.get('verify', 'true') == 'true' \ - and checksums: + if (not Bcfg2.Options.setup.quick and + entry.get('verify', 'true') == 'true' and + checksums): pkgsums = self.VerifyDebsums(entry, modlist) return pkgsums return True -- cgit v1.2.3-1-g7c22