Skip to content
Snippets Groups Projects
Commit 825fd065 authored by Nathan Hertz's avatar Nathan Hertz
Browse files

WS-864: QA for std_cms_imaging

parent a7112a74
No related branches found
No related tags found
1 merge request!751WS-864: QA for std_cms_imaging
Pipeline #4169 passed
"""update std_cms_imaging state machine for QA
Revision ID: 41a10866241c
Revises: 5ba576734f3b
Create Date: 2022-01-25 14:21:15.079550
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "41a10866241c"
down_revision = "5ba576734f3b"
branch_labels = None
depends_on = None
def upgrade():
# Update std_cms_imaging state machine for QA
imaging_st_machine_to_qa_sql = """
UPDATE capability_state_machines SET machine_type = 'single_qa'
WHERE capability_name = 'std_cms_imaging';
"""
op.execute(imaging_st_machine_to_qa_sql)
# Simplify std_calibration's associated_workflows JSON
# (there's currently no need to specify multiple workflow names)
simplify_cal_assoc_wfs_json_sql = """
UPDATE capability_state_machines SET associated_workflows = '{"workflow_name": "std_calibration"}'
WHERE capability_name = 'std_calibration';
"""
op.execute(simplify_cal_assoc_wfs_json_sql)
def downgrade():
# Update std_cms_imaging state machine for QA
undo_imaging_st_machine_to_qa_sql = """
UPDATE capability_state_machines SET machine_type = 'simple'
WHERE capability_name = 'std_cms_imaging';
"""
op.execute(undo_imaging_st_machine_to_qa_sql)
# Simplify std_calibration's associated_workflows JSON
# (there's currently no need to specify multiple workflow names)
undo_simplify_cal_assoc_wfs_json_sql = """
UPDATE capability_state_machines
SET associated_workflows = '{"workflow_name": "std_calibration", "qa_fail_workflow_name": "qa_fail", "qa_pass_workflow_name": "ingest_cal"}'
WHERE capability_name = 'std_calibration';
"""
op.execute(undo_simplify_cal_assoc_wfs_json_sql)
......@@ -98,9 +98,13 @@ class NotificationServiceRESTClient(NotificationServiceIF):
"""
logger.info(f"Wresting contact info for PI & CoIs of request #{version.capability_request_id}")
# TODO:find way to make sure we're using the correct version's parameters
if "calibration" in version.capability.name:
process_call = ["aat_wrest", "-sc", version.parameters["product_locator"]]
else:
process_call = ["aat_wrest", "-si", version.parameters["sdmId"]]
with subprocess.Popen(
["aat_wrest", "-sc", version.parameters["product_locator"]],
process_call,
stdout=subprocess.PIPE,
) as project_data:
data = project_data.communicate()[0]
......
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