Commit aae34ad7 authored by Vincent Pelletier's avatar Vincent Pelletier

Raise UserError instead of Exception.

Buildout output is less scary this way.
parent 02d53a7e
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
# #
############################################################################## ##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
from zc.buildout import UserError
class Recipe(GenericBaseRecipe): class Recipe(GenericBaseRecipe):
""" """
...@@ -79,7 +80,7 @@ class Recipe(GenericBaseRecipe): ...@@ -79,7 +80,7 @@ class Recipe(GenericBaseRecipe):
if not backend_dict: if not backend_dict:
# Fail installation if backend_dict is empty, otherwise partition may be # Fail installation if backend_dict is empty, otherwise partition may be
# advertised as available although it provides no service. # advertised as available although it provides no service.
raise Exception('backend-dict is empty') raise UserError('backend-dict is empty')
server_snippet_filename = self.getTemplateFilename( server_snippet_filename = self.getTemplateFilename(
'haproxy-server-snippet.cfg.in') 'haproxy-server-snippet.cfg.in')
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
# #
############################################################################## ##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
from zc.buildout import UserError
class NeoBaseRecipe(GenericBaseRecipe): class NeoBaseRecipe(GenericBaseRecipe):
...@@ -39,7 +40,7 @@ class NeoBaseRecipe(GenericBaseRecipe): ...@@ -39,7 +40,7 @@ class NeoBaseRecipe(GenericBaseRecipe):
# allocated. # allocated.
# Only then can this recipe start succeeding and actually doing anything # Only then can this recipe start succeeding and actually doing anything
# useful, as per NEO deploying constraints. # useful, as per NEO deploying constraints.
raise Exception('"masters" parameter is mandatory') raise UserError('"masters" parameter is mandatory')
option_list = [ option_list = [
options['binary'], options['binary'],
'-l', options['logfile'], '-l', options['logfile'],
......
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