Commit 362c2f6b authored by Marco Mariani's avatar Marco Mariani

jsondump recipes: return paths and update files

parent bb742760
......@@ -10,10 +10,13 @@ class Recipe(object):
if key not in ['json-output', 'recipe']
}
with os.fdopen(os.open(options['json-output'], os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600), 'w') as fout:
self._json_output = options['json-output']
with os.fdopen(os.open(self._json_output, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600), 'w') as fout:
fout.write(json.dumps(parameter_dict, indent=2, sort_keys=True))
fout.close()
def install(self):
return []
return [self._json_output]
update = install
......@@ -170,6 +170,12 @@ class Serialised(Recipe):
class JsonDump(Recipe):
def __init__(self, buildout, name, options):
parameter_dict = self.fetch_parameter_dict(options)
with os.fdopen(os.open(options['json-output'], os.O_WRONLY | os.O_CREAT, 0600), 'w') as fout:
self._json_output = options['json-output']
with os.fdopen(os.open(self._json_output, os.O_WRONLY | os.O_CREAT, 0600), 'w') as fout:
fout.write(json.dumps(parameter_dict, indent=2, sort_keys=True))
def install(self):
return [self._json_output]
update = install
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