diff --git a/shared/workspaces/alembic/versions/762c98a8adf1_pims_split_quicklook_corrections.py b/shared/workspaces/alembic/versions/762c98a8adf1_pims_split_quicklook_corrections.py index 52b246ecb1619de070075cc0bcf60dead44d88c2..c73b2815a5db98a02e11ecdf93e1290df90dc02f 100644 --- a/shared/workspaces/alembic/versions/762c98a8adf1_pims_split_quicklook_corrections.py +++ b/shared/workspaces/alembic/versions/762c98a8adf1_pims_split_quicklook_corrections.py @@ -43,7 +43,7 @@ Iterating over {{#splits}} to make the "splits" array which has the format: """ old_metadata = """{"systemId": "{{request_id}}", "fileSetIds": ["{{sdmId}}", "{{calSdmId}}"], "creationTime": "{{created_at}}", "workflowName": "pims_split", "productLocator": "{{product_locator}}", "calProductLocator": "{{cal_locator}}", "destinationDirectory": "{{root_directory}}/{{relative_path}}", "token": "{{token}}", "splits": ["{{split_dir}}", "{{quicklook_url}}"], "casaHome": "{{casaHome}}", "data_location": "{{data_location}}", "vlass_product": "{{vlass_product}}", "existing_restore": "{{existing_restore}}", "need_project_metadata": "{{need_project_metadata}}"}""" -new_metadata = """{"systemId": "{{request_id}}", "fileSetIds": ["{{sdmId}}", "{{calSdmId}}"], "creationTime": "{{created_at}}", "workflowName": "pims_split", "productLocator": "{{product_locator}}", "calProductLocator": "{{cal_locator}}", "destinationDirectory": "{{root_directory}}/{{relative_path}}", "token": "{{token}}", "splits": [{{#splits}}{"split_dir": "{{split_dir}}", "quicklook_url": "{{quicklook_url}}"},{{/splits}}], "casaHome": "{{casaHome}}", "data_location": "{{data_location}}", "vlass_product": "{{vlass_product}}", "existing_restore": "{{existing_restore}}", "need_project_metadata": "{{need_project_metadata}}"}""" +new_metadata = """{"systemId": "{{request_id}}", "fileSetIds": ["{{sdmId}}", "{{calSdmId}}"], "creationTime": "{{created_at}}", "workflowName": "pims_split", "productLocator": "{{product_locator}}", "calProductLocator": "{{cal_locator}}", "destinationDirectory": "{{root_directory}}/{{relative_path}}", "token": "{{token}}", "splits": {{{splits_str}}}, "casaHome": "{{casaHome}}", "data_location": "{{data_location}}", "vlass_product": "{{vlass_product}}", "existing_restore": "{{existing_restore}}", "need_project_metadata": "{{need_project_metadata}}"}""" # Conditionalize the quicklook_url argument in the condor file diff --git a/shared/workspaces/workspaces/workflow/schema.py b/shared/workspaces/workspaces/workflow/schema.py index 4f799f01e45939e528b0241175710e347aaedc48..17f94da21d4ea11c87b721edb573d12807672d33 100644 --- a/shared/workspaces/workspaces/workflow/schema.py +++ b/shared/workspaces/workspaces/workflow/schema.py @@ -16,6 +16,7 @@ # You should have received a copy of the GNU General Public License # along with Workspaces. If not, see <https://www.gnu.org/licenses/>. import datetime +import json import logging from typing import Callable, Dict, List @@ -155,6 +156,9 @@ class WorkflowTemplate(JSONSerializable): """ # add some rendering helpers to the argument render_helpers = {"make_condor_jobname": self.make_condor_jobname} + if "splits" in argument: + argument["splits_str"] = json.dumps(argument["splits"]) + argument = {**render_helpers, **argument} # render