KVM frontend : Check mandatory field before continuing

parent dac8cd44
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
############################################################################## ##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
import json import json
import zc.buildout
class Recipe(GenericBaseRecipe): class Recipe(GenericBaseRecipe):
""" """
...@@ -82,6 +83,10 @@ class Recipe(GenericBaseRecipe): ...@@ -82,6 +83,10 @@ class Recipe(GenericBaseRecipe):
return proxy_table_content return proxy_table_content
def install(self): def install(self):
# Check for mandatory field
if self.options.get('domain', None) is None:
raise zc.buildout.UserError('No domain name specified. Please define '
'the "domain" instance parameter.')
# Generate rewrite rules # Generate rewrite rules
rewrite_rule_list = self._getRewriteRuleContent( rewrite_rule_list = self._getRewriteRuleContent(
json.loads(self.options['slave-instance-list'])) json.loads(self.options['slave-instance-list']))
......
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