diff options
-rw-r--r-- | src/lib/Client/Tools/Upstart.py | 9 |
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: |