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):
def _generateRealTemplate(self):
# 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
font_url_list = json_data.get('font_url_list', [])
fontconfig_template = open(self.options['template']).read()
......@@ -50,10 +52,9 @@ class Recipe(GenericSlapRecipe):
def _install(self):
if not os.path.exists(self.dirname):
os.mkdir(self.dirname)
if "cloudooo-json" in self.parameter_dict:
try:
self._generateRealTemplate()
except Exception:
print 'Ignored issue during template generation:\n%s' % \
traceback.format_exc()
try:
self._generateRealTemplate()
except Exception:
print 'Ignored issue during template generation:\n%s' % \
traceback.format_exc()
return [self.dirname]
......@@ -22,6 +22,7 @@ offline = true
[slap-parameter]
# default site id
site-id = erp5
cloudooo-json =
[test-runner]
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