summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-01-16 16:01:57 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-01-16 16:01:57 +0000
commit7ab3a36c1c5c6a25956910e283ff435188c247c1 (patch)
treea97ae46fa2d5cd6a781cc8cb557be51fec8c142e /src/lib/Client/Tools
parent8340206111ea2375589ea78ccb2142de21d292c0 (diff)
downloadbcfg2-7ab3a36c1c5c6a25956910e283ff435188c247c1.tar.gz
bcfg2-7ab3a36c1c5c6a25956910e283ff435188c247c1.tar.bz2
bcfg2-7ab3a36c1c5c6a25956910e283ff435188c247c1.zip
Pylint fixes
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2681 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools')
-rw-r--r--src/lib/Client/Tools/DebInit.py2
-rw-r--r--src/lib/Client/Tools/Encap.py2
-rw-r--r--src/lib/Client/Tools/Portage.py6
-rw-r--r--src/lib/Client/Tools/launchd.py14
4 files changed, 13 insertions, 11 deletions
diff --git a/src/lib/Client/Tools/DebInit.py b/src/lib/Client/Tools/DebInit.py
index c1fbffad6..addf3c1a8 100644
--- a/src/lib/Client/Tools/DebInit.py
+++ b/src/lib/Client/Tools/DebInit.py
@@ -60,7 +60,7 @@ class DebInit(Bcfg2.Client.Tools.SvcTool):
return [Bcfg2.Client.XML.Element('Service', name=name, type='deb') for name \
in extra]
- def Remove(self, entries):
+ def Remove(self, _):
'''Remove extra service entries'''
# Extra service removal is nonsensical
# Extra services need to be reflected in the config
diff --git a/src/lib/Client/Tools/Encap.py b/src/lib/Client/Tools/Encap.py
index 4e9ef6c10..102eb0987 100644
--- a/src/lib/Client/Tools/Encap.py
+++ b/src/lib/Client/Tools/Encap.py
@@ -26,7 +26,7 @@ class Encap(Bcfg2.Client.Tools.PkgTool):
self.installed[match.group('name')] = match.group('version')
else:
print "Failed to split name %s" % pkg
- self.logger.debug("Encap.py: RefreshPackages: self.installed.keys() are:")
+ self.logger.debug("Encap.py: RefreshPackages: self.installed.keys() are:")
self.logger.debug("%s" % self.installed.keys())
def VerifyPackage(self, entry, _):
diff --git a/src/lib/Client/Tools/Portage.py b/src/lib/Client/Tools/Portage.py
index 0eb6c3476..3116578b0 100644
--- a/src/lib/Client/Tools/Portage.py
+++ b/src/lib/Client/Tools/Portage.py
@@ -15,7 +15,7 @@ class Portage(Bcfg2.Client.Tools.PkgTool):
__handles__ = [('Package', 'ebuild')]
__req__ = {'Package': ['name', 'version']}
pkgtype = 'ebuild'
- '''requires a working PORTAGE_BINHOST in make.conf'''
+ # requires a working PORTAGE_BINHOST in make.conf
pkgtool = ('emerge --getbinpkgonly =%s', ('%s-%s', ['name', 'version']))
def __init__(self, logger, cfg, setup, states):
@@ -33,8 +33,8 @@ class Portage(Bcfg2.Client.Tools.PkgTool):
for pkg in cache:
pattern = re.compile('(.*)-(\d.*)')
if pattern.match(pkg):
- name = pattern.match(pkg).group(1)
- version = pattern.match(pkg).group(2)
+ name = pattern.match(pkg).group(1)
+ version = pattern.match(pkg).group(2)
self.installed[name] = version
def VerifyPackage(self, entry, modlist):
diff --git a/src/lib/Client/Tools/launchd.py b/src/lib/Client/Tools/launchd.py
index b0b657dfc..177169dac 100644
--- a/src/lib/Client/Tools/launchd.py
+++ b/src/lib/Client/Tools/launchd.py
@@ -1,7 +1,7 @@
'''launchd support for Bcfg2'''
__revision__ = '$Revision: 2596 $'
-import glob, os
+import os
import Bcfg2.Client.Tools
class launchd(Bcfg2.Client.Tools.Tool):
@@ -13,12 +13,12 @@ class launchd(Bcfg2.Client.Tools.Tool):
#currently requires the path to the plist to load/unload, and Name is acually a reverse-fqdn (or the label)
def FindPlist(self, entry):
- '''Locate plist file that provides given reverse-fqdn name'''
- '''/Library/LaunchAgents Per-user agents provided by the administrator.
+ '''Locate plist file that provides given reverse-fqdn name
+ /Library/LaunchAgents Per-user agents provided by the administrator.
/Library/LaunchDaemons System wide daemons provided by the administrator.
/System/Library/LaunchAgents Mac OS X Per-user agents.
/System/Library/LaunchDaemons Mac OS X System wide daemons.'''
- plistLocations = ["/Library/LaunchDaemons","/System/Library/LaunchDaemons"]
+ plistLocations = ["/Library/LaunchDaemons", "/System/Library/LaunchDaemons"]
plistMapping = {}
for directory in plistLocations:
for daemon in os.listdir(directory):
@@ -27,7 +27,9 @@ class launchd(Bcfg2.Client.Tools.Tool):
d = daemon[:(len(daemon)-6)]
else:
d = daemon
- plistMapping[self.cmd.run("defaults read %s/%s Label"%(directory,d))[1][0]] = "%s/%s"%(directory,daemon)
+ plistMapping[self.cmd.run( \
+ "defaults read %s/%s Label" % (directory, d))[1][0]] = \
+ "%s/%s"%(directory, daemon)
except KeyError: #perhaps this could be more robust
pass
try:
@@ -74,7 +76,7 @@ class launchd(Bcfg2.Client.Tools.Tool):
try:
allsrv = self.cmd.run("/bin/launchctl list")[1]
except IndexError:
- allsrv = [];
+ allsrv = []
[allsrv.remove(svc) for svc in [entry.get("name") for entry
in self.getSupportedEntries()] if svc in allsrv]