Skip to content
Snippets Groups Projects
Commit 3514dffb authored by Jonas Höppner's avatar Jonas Höppner
Browse files

alphaplan_fwr.py: Silently ignore if 'output_dir is not set

parent 610e4a46
No related branches found
No related tags found
No related merge requests found
......@@ -228,13 +228,16 @@ def generate_fwr_articles(
)
jsonfile_uboot_name = "alphaplan-import-uboot-{}.json".format(machine)
jsonfile_uboot_local = os.path.join(outlocal_dir, machine, jsonfile_uboot_name)
jsonfile_uboot_output = os.path.join(output_dir, machine, jsonfile_uboot_name)
with open(jsonfile_uboot_local, "w", encoding="utf-8") as jsonfile:
json.dump(data_uboot, jsonfile, indent=4)
shutil.copyfile(
jsonfile_uboot_local, jsonfile_uboot_output, follow_symlinks=True
)
if output_dir is not None:
jsonfile_uboot_output = os.path.join(
output_dir, machine, jsonfile_uboot_name
)
shutil.copyfile(
jsonfile_uboot_local, jsonfile_uboot_output, follow_symlinks=True
)
# Send data object to AlphaPlan webservice
ap_send_json(data_uboot)
......@@ -242,10 +245,12 @@ def generate_fwr_articles(
# Generate a json file from the dict/list structure for debugging
jsonfile_name = "alphaplan-import-{}.json".format(machine)
jsonfile_local = os.path.join(outlocal_dir, machine, jsonfile_name)
jsonfile_output = os.path.join(output_dir, machine, jsonfile_name)
with open(jsonfile_local, "w", encoding="utf-8") as jsonfile:
json.dump(data, jsonfile, indent=4)
# Copy file to release folder as the atrifacts have already been copied
shutil.copyfile(jsonfile_local, jsonfile_output, follow_symlinks=True)
if output_dir is not None:
# Copy file to release folder as the atrifacts have already been copied
jsonfile_output = os.path.join(output_dir, machine, jsonfile_name)
shutil.copyfile(jsonfile_local, jsonfile_output, follow_symlinks=True)
# Send data object to AlphaPlan webservice
ap_send_json(data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment