Commit de71044b authored by Tatuya Kamada's avatar Tatuya Kamada

Fix the issue that generate.cloudooo recipe does not work

when we do not put the cloudoo-json parameter as a slapos-parameter.
parent e35f1361
...@@ -38,7 +38,9 @@ class Recipe(GenericSlapRecipe): ...@@ -38,7 +38,9 @@ class Recipe(GenericSlapRecipe):
def _generateRealTemplate(self): def _generateRealTemplate(self):
# TODO check json against schema # TODO check json against schema
json_data = json.loads(self.parameter_dict['cloudooo-json']) json_data = {}
if self.parameter_dict.get('cloudooo-json', None):
json_data = json.loads(self.parameter_dict['cloudooo-json'])
# dymanic fonts # dymanic fonts
font_url_list = json_data.get('font_url_list', []) font_url_list = json_data.get('font_url_list', [])
fontconfig_template = open(self.options['template']).read() fontconfig_template = open(self.options['template']).read()
...@@ -50,10 +52,9 @@ class Recipe(GenericSlapRecipe): ...@@ -50,10 +52,9 @@ class Recipe(GenericSlapRecipe):
def _install(self): def _install(self):
if not os.path.exists(self.dirname): if not os.path.exists(self.dirname):
os.mkdir(self.dirname) os.mkdir(self.dirname)
if "cloudooo-json" in self.parameter_dict: try:
try: self._generateRealTemplate()
self._generateRealTemplate() except Exception:
except Exception: print 'Ignored issue during template generation:\n%s' % \
print 'Ignored issue during template generation:\n%s' % \ traceback.format_exc()
traceback.format_exc()
return [self.dirname] return [self.dirname]
...@@ -22,6 +22,7 @@ offline = true ...@@ -22,6 +22,7 @@ offline = true
[slap-parameter] [slap-parameter]
# default site id # default site id
site-id = erp5 site-id = erp5
cloudooo-json =
[test-runner] [test-runner]
recipe = slapos.cookbook:erp5.test recipe = slapos.cookbook:erp5.test
......
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