summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/launchd.py
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/launchd.py
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/launchd.py')
-rw-r--r--src/lib/Client/Tools/launchd.py14
1 files changed, 8 insertions, 6 deletions
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]