summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-04-29 16:31:15 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-04-29 11:31:21 -0500
commit258025085e8d4a0e4129bf1d2dd36ed7ac8786b2 (patch)
tree4ac45cddcab7b37be1c89e7b23a221caaf30a9d3 /src
parent8b1bfc72757816a8618ab4bfef01385b6de5b3bb (diff)
downloadbcfg2-258025085e8d4a0e4129bf1d2dd36ed7ac8786b2.tar.gz
bcfg2-258025085e8d4a0e4129bf1d2dd36ed7ac8786b2.tar.bz2
bcfg2-258025085e8d4a0e4129bf1d2dd36ed7ac8786b2.zip
Upstart: Fix traceback for non-upstart services (Resolves Ticket #878)
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5847 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Tools/Upstart.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Client/Tools/Upstart.py b/src/lib/Client/Tools/Upstart.py
index 1fc80a1db..b6e68d549 100644
--- a/src/lib/Client/Tools/Upstart.py
+++ b/src/lib/Client/Tools/Upstart.py
@@ -29,8 +29,13 @@ class Upstart(Bcfg2.Client.Tools.SvcTool):
/etc/init/servicename.conf. All we need to do is make sure
the service is running when it should be.
'''
- output = self.cmd.run('/usr/sbin/service %s status' % \
- entry.get('name'))[1][0]
+ try:
+ output = self.cmd.run('/usr/sbin/service %s status' % \
+ entry.get('name'))[1][0]
+ except IndexError:
+ self.logger.error("Service %s not an Upstart service" % \
+ entry.get('name'))
+ return False
try:
running = output.split(' ')[1].split('/')[1].startswith('running')
if running: