Don't crash if one slave is bad

parent 471c780c
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
############################################################################## ##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe, GenericSlapRecipe from slapos.recipe.librecipe import GenericBaseRecipe, GenericSlapRecipe
import json import json
import traceback
import zc.buildout import zc.buildout
class Recipe(GenericSlapRecipe): class Recipe(GenericSlapRecipe):
...@@ -127,11 +128,15 @@ class Recipe(GenericSlapRecipe): ...@@ -127,11 +128,15 @@ class Recipe(GenericSlapRecipe):
# Send connection parameters of slave instances # Send connection parameters of slave instances
site_url = "https://%s:%s/" % (self.options['domain'], self.options['port']) site_url = "https://%s:%s/" % (self.options['domain'], self.options['port'])
for slave in rewrite_rule_list: for slave in rewrite_rule_list:
self.setConnectionDict( try:
dict(url="%s%s" % (site_url, slave['resource']), self.setConnectionDict(
domainname=self.options['domain'], dict(url="%s%s" % (site_url, slave['resource']),
port=self.options['port'], domainname=self.options['domain'],
resource=slave['resource']), port=self.options['port'],
slave['reference']) resource=slave['resource']),
slave['reference'])
except:
self.logger.fatal("Error while sending slave %s informations: %s",
slave['reference'], traceback.format_exc())
return [map_file, conf_file, runner_path] return [map_file, conf_file, runner_path]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment