From 2e11c652590b9d6ef92fe363e6211421cb3ffbf8 Mon Sep 17 00:00:00 2001 From: chausman <chausman@nrao.edu> Date: Mon, 13 Sep 2021 11:41:20 -0600 Subject: [PATCH] fix single image carta crashing --- .../01de4f42cf27_fix_single_image_carta.py | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 schema/versions/01de4f42cf27_fix_single_image_carta.py diff --git a/schema/versions/01de4f42cf27_fix_single_image_carta.py b/schema/versions/01de4f42cf27_fix_single_image_carta.py new file mode 100644 index 000000000..8d71038b3 --- /dev/null +++ b/schema/versions/01de4f42cf27_fix_single_image_carta.py @@ -0,0 +1,64 @@ +"""fix single image carta + +Revision ID: 01de4f42cf27 +Revises: b3667e00ef4a +Create Date: 2021-09-13 11:39:00.808773 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = "01de4f42cf27" +down_revision = "b3667e00ef4a" +branch_labels = None +depends_on = None + +script_content = """#!/bin/sh +set -o errexit + +export HOME=$TMPDIR + +{{#need_data}} +./framework.sh -r . +chmod 770 . +cd rawdata/ +../productfetcher{{product_locator}} {{^single_image}}&{{/single_image}} +.{{/need_data}}./carta_envoy {{#need_data}}--parallel{{/need_data}} {{#single_image}}--single -i {{imageName}}{{/single_image}} -d $1 -n $2 -wf $3 -r $4 +{{#need_data}}wait{{/need_data}} + +""" + +old_content = """#!/bin/sh +set -o errexit + +export HOME=$TMPDIR + +{{#need_data}} +./framework.sh -r . +chmod 770 . +cd rawdata/ +../productfetcher{{product_locator}} & +.{{/need_data}}./carta_envoy {{#need_data}}--parallel{{/need_data}} {{#single_image}}--single -i {{imageName}}{{/single_image}} -d $1 -n $2 -wf $3 -r $4 +{{#need_data}}wait{{/need_data}} + +""" + + +def upgrade(): + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{script_content}' WHERE filename='carta.sh' + """ + ) + + +def downgrade(): + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{old_content}' WHERE filename='carta.sh' + """ + ) -- GitLab