From cae39b746051ff5f3257342d0659340283b2d6ef Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 24 Feb 2015 16:29:07 -0600 Subject: Fix pylint errors This also pins pylint to <= 0.28 so we don't have to keep playing whack-a-mole with it. Also removes unnecessary suppression of apt warnings. This is no longer necessary in 12.04, so should be safe to remove. If you're on Ubuntu < 12.04, upgrade for heaven's sake. --- src/lib/Bcfg2/Client/Tools/APT.py | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 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 300c9bc51..3c511681f 100644 --- a/src/lib/Bcfg2/Client/Tools/APT.py +++ b/src/lib/Bcfg2/Client/Tools/APT.py @@ -1,12 +1,10 @@ """This is the Bcfg2 support for apt-get.""" -# suppress apt API warnings -import warnings -warnings.filterwarnings("ignore", "apt API not stable yet", - FutureWarning) -import apt.cache import os import sys + +import apt.cache + import Bcfg2.Client.Tools @@ -47,20 +45,20 @@ class APT(Bcfg2.Client.Tools.Tool): for entry in struct if entry.tag == 'Path' and entry.get('type') == 'ignore'] - self.__important__ = self.__important__ + \ - ["%s/cache/debconf/config.dat" % self.var_path, - "%s/cache/debconf/templates.dat" % self.var_path, - '/etc/passwd', '/etc/group', - '%s/apt/apt.conf' % self.etc_path, - '%s/dpkg/dpkg.cfg' % self.etc_path] + \ + self.__important__ = self.__important__ + [ + "%s/cache/debconf/config.dat" % self.var_path, + "%s/cache/debconf/templates.dat" % self.var_path, + '/etc/passwd', '/etc/group', + '%s/apt/apt.conf' % self.etc_path, + '%s/dpkg/dpkg.cfg' % self.etc_path] + \ [entry.get('name') for struct in config for entry in struct - if entry.tag == 'Path' and - entry.get('name').startswith( - '%s/apt/sources.list' % self.etc_path)] + if (entry.tag == 'Path' and + entry.get('name').startswith( + '%s/apt/sources.list' % self.etc_path)] self.nonexistent = [entry.get('name') for struct in config for entry in struct - if entry.tag == 'Path' and - entry.get('type') == 'nonexistent'] + if (entry.tag == 'Path' and + entry.get('type') == 'nonexistent')] os.environ["DEBIAN_FRONTEND"] = 'noninteractive' self.actions = {} if self.setup['kevlar'] and not self.setup['dryrun']: -- cgit v1.2.3-1-g7c22 From c8863b9a2dadacdacf433cbb818735c32e8f83a8 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Thu, 19 Mar 2015 09:35:48 -0500 Subject: APT.py: Fix syntax error introduced in cae39b7 Signed-off-by: Sol Jerome --- src/lib/Bcfg2/Client/Tools/APT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 3c511681f..1d9b0dd70 100644 --- a/src/lib/Bcfg2/Client/Tools/APT.py +++ b/src/lib/Bcfg2/Client/Tools/APT.py @@ -54,7 +54,7 @@ class APT(Bcfg2.Client.Tools.Tool): [entry.get('name') for struct in config for entry in struct if (entry.tag == 'Path' and entry.get('name').startswith( - '%s/apt/sources.list' % self.etc_path)] + '%s/apt/sources.list' % self.etc_path))] self.nonexistent = [entry.get('name') for struct in config for entry in struct if (entry.tag == 'Path' and -- cgit v1.2.3-1-g7c22