Skip to content
Snippets Groups Projects
Commit fda269d9 authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

fixing aat-wrest access for restores

parent 823cf848
No related branches found
No related tags found
1 merge request!355Post Server Apocalypse Round 2
Pipeline #2224 passed
This commit is part of merge request !355. Comments created here will be created in the context of that merge request.
......@@ -61,7 +61,6 @@ def determine_wrester(connection: MDDBConnector, args: argparse.Namespace):
elif args.stdimg:
data = WrestWorkflowMetadata(connection, sdm_id=args.stdimg[0]).wrest_standard_image_info()
elif args.restore:
print(args)
data = WrestWorkflowMetadata(connection, spl=args.restore).wrest_restore_info()
elif args.observation:
data = WrestObservationMetadata(
......
......@@ -235,22 +235,26 @@ class WorkflowService(WorkflowServiceIF):
if "calibration" in name:
wrest_type = "-sc"
argument = wf_request.argument["product_locator"]
argument2 = []
elif "restore" in name:
wrest_type = "-r"
argument = [wf_request.argument["product_locator"], wf_request.argument["cal_locator"]]
argument = wf_request.argument["product_locator"]
argument2 = [wf_request.argument["cal_locator"]]
elif "imaging" in name:
wrest_type = "-si"
argument = wf_request.argument["sdmId"]
argument2 = []
else:
logger.info(f"No wrester found for workflow {name}. Does it actually require metadata?")
return wf_request
logger.info(f" workflow {name} has wrest option: {wrest_type}")
with subprocess.Popen(
["aat_wrest", wrest_type, argument],
["aat_wrest", wrest_type, argument] + argument2,
stdout=subprocess.PIPE,
) as wf_metadata:
wf_json = wf_metadata.communicate()[0]
logger.info(wf_json.decode())
if "ERROR" not in wf_json.decode():
merged_args = {
**json.loads(wf_json),
......
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