summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/launchd.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2010-10-17 20:43:16 -0500
committerSol Jerome <sol.jerome@gmail.com>2010-10-17 20:43:16 -0500
commitb056804f3d3e3a2d92dac42062527873255d14c7 (patch)
tree0685c311e66f75064b5f651219a488e6ee4634d8 /src/lib/Client/Tools/launchd.py
parentff01b4e6ad3dcf7fdae92adc16c1a3481a37d8db (diff)
downloadbcfg2-b056804f3d3e3a2d92dac42062527873255d14c7.tar.gz
bcfg2-b056804f3d3e3a2d92dac42062527873255d14c7.tar.bz2
bcfg2-b056804f3d3e3a2d92dac42062527873255d14c7.zip
Client Tools: Pylint/PEP8 fixes
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Client/Tools/launchd.py')
-rw-r--r--src/lib/Client/Tools/launchd.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/Client/Tools/launchd.py b/src/lib/Client/Tools/launchd.py
index a8b785016..db6d94c1b 100644
--- a/src/lib/Client/Tools/launchd.py
+++ b/src/lib/Client/Tools/launchd.py
@@ -2,20 +2,23 @@
__revision__ = '$Revision$'
import os
-import Bcfg2.Client.Tools
import popen2
+import Bcfg2.Client.Tools
+
+
class launchd(Bcfg2.Client.Tools.Tool):
"""Support for Mac OS X launchd services."""
__handles__ = [('Service', 'launchd')]
__execs__ = ['/bin/launchctl', '/usr/bin/defaults']
name = 'launchd'
- __req__ = {'Service':['name', 'status']}
+ __req__ = {'Service': ['name', 'status']}
'''
Currently requires the path to the plist to load/unload,
and Name is acually a reverse-fqdn (or the label).
'''
+
def __init__(self, logger, setup, config):
Bcfg2.Client.Tools.Tool.__init__(self, logger, setup, config)
@@ -77,7 +80,6 @@ class launchd(Bcfg2.Client.Tools.Tool):
return 'on'
return False
-
def InstallService(self, entry):
"""Enable or disable launchd item."""
name = entry.get('name')
@@ -95,18 +97,19 @@ class launchd(Bcfg2.Client.Tools.Tool):
"""Remove Extra launchd entries."""
pass
-
-
def FindExtra(self):
"""Find Extra launchd services."""
try:
- allsrv = self.cmd.run("/bin/launchctl list")[1]
+ allsrv = self.cmd.run("/bin/launchctl list")[1]
except IndexError:
allsrv = []
[allsrv.remove(svc) for svc in [entry.get("name") for entry
in self.getSupportedEntries()] if svc in allsrv]
- return [Bcfg2.Client.XML.Element("Service", type='launchd', name=name, status='on') for name in allsrv]
+ return [Bcfg2.Client.XML.Element("Service",
+ type='launchd',
+ name=name,
+ status='on') for name in allsrv]
def BundleUpdated(self, bundle, states):
"""Reload launchd plist."""
@@ -126,4 +129,3 @@ class launchd(Bcfg2.Client.Tools.Tool):
#only if necessary....
self.cmd.run("/bin/launchctl stop %s" % name)
self.cmd.run("/bin/launchctl unload -w %s" % (self.FindPlist(entry)))
-