From: Tomas Sedovic Date: Wed, 25 Apr 2012 14:34:59 +0000 (+0200) Subject: Log when cfn-hup couldn't restart a service X-Git-Tag: 2014.1~1923^2~13 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c227c4581a0b77b19db5ed5b13006d2656283433;p=openstack-build%2Fheat-build.git Log when cfn-hup couldn't restart a service `service.restarted` hooks are not run when the restart failed. Signed-off-by: Tomas Sedovic --- diff --git a/heat/cfntools/cfn_helper.py b/heat/cfntools/cfn_helper.py index 2267646f..475d1e7e 100644 --- a/heat/cfntools/cfn_helper.py +++ b/heat/cfntools/cfn_helper.py @@ -533,7 +533,11 @@ class ServicesHandler(object): running = command.status == 0 if ensure_running and not running: logging.info("Restarting service %s" % service) - handler(self, service, "start") + start_cmd = handler(self, service, "start") + if start_cmd.status != 0: + logging.warning('Service %s did not start. STDERR: %s' % + (service, start_cmd.stderr)) + return for h in self.hooks: self.hooks[h].event('service.restarted', service, self.resource)