Merge "enable output of metadata to a file"

This commit is contained in:
Jenkins 2016-03-29 10:22:28 +00:00 committed by Gerrit Code Review
commit 3497834323

View File

@ -115,9 +115,12 @@ def run_job(conf, storage):
'exec': job.ExecJob}[conf.action](conf, storage)
response = freezer_job.execute()
if conf.metadata_out == '-':
if response:
if conf.metadata_out and response:
if conf.metadata_out == '-':
sys.stdout.write(json.dumps(response))
else:
with open(conf.metadata_out, 'w') as outfile:
outfile.write(json.dumps(response))
def fail(exit_code, e, quiet, do_log=True):