summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/launchd.py
diff options
context:
space:
mode:
authorFabian Affolter <fabian@bernewireless.net>2010-06-07 13:23:13 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-06-07 08:42:53 -0500
commit97063d26e56b7dccf73ec548e82ccd101d8cbd83 (patch)
treea91bc7e585d2277061ce72d1ee92eb3b0598a212 /src/lib/Client/Tools/launchd.py
parent7e63c759095bd90c6aff7b7ebcafe2535e27b7cd (diff)
downloadbcfg2-97063d26e56b7dccf73ec548e82ccd101d8cbd83.tar.gz
bcfg2-97063d26e56b7dccf73ec548e82ccd101d8cbd83.tar.bz2
bcfg2-97063d26e56b7dccf73ec548e82ccd101d8cbd83.zip
Updated files to match PEP 257
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5897 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools/launchd.py')
-rw-r--r--src/lib/Client/Tools/launchd.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/Client/Tools/launchd.py b/src/lib/Client/Tools/launchd.py
index 2b035b6a8..a8b785016 100644
--- a/src/lib/Client/Tools/launchd.py
+++ b/src/lib/Client/Tools/launchd.py
@@ -1,4 +1,4 @@
-'''launchd support for Bcfg2'''
+"""launchd support for Bcfg2."""
__revision__ = '$Revision$'
import os
@@ -6,15 +6,15 @@ import Bcfg2.Client.Tools
import popen2
class launchd(Bcfg2.Client.Tools.Tool):
- '''Support for Mac OS X Launchd Services'''
+ """Support for Mac OS X launchd services."""
__handles__ = [('Service', 'launchd')]
__execs__ = ['/bin/launchctl', '/usr/bin/defaults']
name = 'launchd'
__req__ = {'Service':['name', 'status']}
'''
- currently requires the path to the plist to load/unload,
- and Name is acually a reverse-fqdn (or the label)
+ 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)
@@ -55,7 +55,7 @@ class launchd(Bcfg2.Client.Tools.Tool):
return version
def VerifyService(self, entry, _):
- '''Verify Launchd Service Entry'''
+ """Verify launchd service entry."""
try:
services = self.cmd.run("/bin/launchctl list")[1]
except IndexError:#happens when no services are running (should be never)
@@ -79,7 +79,7 @@ class launchd(Bcfg2.Client.Tools.Tool):
def InstallService(self, entry):
- '''Enable or Disable launchd Item'''
+ """Enable or disable launchd item."""
name = entry.get('name')
if entry.get('status') == 'on':
self.logger.error("Installing service %s" % name)
@@ -92,13 +92,13 @@ class launchd(Bcfg2.Client.Tools.Tool):
return cmdrc[0] == 0
def Remove(self, svcs):
- '''Remove Extra launchd entries'''
+ """Remove Extra launchd entries."""
pass
def FindExtra(self):
- '''Find Extra launchd Services'''
+ """Find Extra launchd services."""
try:
allsrv = self.cmd.run("/bin/launchctl list")[1]
except IndexError:
@@ -109,7 +109,7 @@ class launchd(Bcfg2.Client.Tools.Tool):
return [Bcfg2.Client.XML.Element("Service", type='launchd', name=name, status='on') for name in allsrv]
def BundleUpdated(self, bundle, states):
- '''Reload launchd plist'''
+ """Reload launchd plist."""
for entry in [entry for entry in bundle if self.handlesEntry(entry)]:
if not self.canInstall(entry):
self.logger.error("Insufficient information to restart service %s" % (entry.get('name')))