Skip to content

Commit 847d44e

Browse files
author
bshifaw
authored
imported functions from metadata command to request workflow metadata using cromshell default slim metadata keys (#169)
1 parent eaf6193 commit 847d44e

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/cromshell/status/command.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import requests
88

99
from cromshell import log
10+
from cromshell.metadata import command as metadata_command
1011
from cromshell.utilities import cromshellconfig, http_utils, io_utils
1112

1213
LOGGER = logging.getLogger(__name__)
@@ -57,11 +58,18 @@ def main(config, workflow_id):
5758
elif workflow_status == "Running":
5859
# Status claims this workflow is running fine, but we need to check to see
5960
# if there are any failed sub-processes.
60-
# To do this, we use the `execution-status-count` logic with some filtering:
61-
# TODO : Use this as a template for the Metadata subcommand
62-
# Get execution status count and filter the metadata down:
61+
# To do this, we get the workflow metadata and search for any failures
62+
formatted_metadata_parameter = metadata_command.format_metadata_params(
63+
list_of_keys=config.SLIM_METADATA_DEFAULT_KEYS,
64+
exclude_keys=False,
65+
expand_subworkflows=True,
66+
)
67+
6368
request_meta_out = requests.get(
64-
f"{config.cromwell_api_workflow_id}/metadata?{config.slim_metadata_parameters}"
69+
f"{config.cromwell_api_workflow_id}/metadata",
70+
params=formatted_metadata_parameter,
71+
timeout=config.requests_connect_timeout,
72+
verify=config.requests_verify_certs,
6573
)
6674

6775
# metadata holds the workflow metadata as a dictionary

0 commit comments

Comments
 (0)