Skip to content

Commit 62532c3

Browse files
authored
Merge pull request #49 from ecmwf-projects/add-adaptor_configuration
Add adaptor configuration
2 parents e1510e4 + d355ca1 commit 62532c3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cads_processing_api_service/adaptors.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ def make_system_request(
6464
except AttributeError:
6565
entry_point = FALLBACK_ENTRY_POINT
6666

67-
try:
68-
config = resource.config
69-
except AttributeError:
67+
config = resource.adaptor_configuration
68+
if config is None:
7069
config = FALLBACK_CONFIG.copy()
7170
config["collection_id"] = process_id
7271

tests/test_20_adaptors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ def test_make_system_request_default() -> None:
2626

2727
exp_setup_code = adaptors.FALLBACK_SETUP_CODE
2828
exp_entry_point = adaptors.FALLBACK_ENTRY_POINT
29-
exp_kwargs = {"request": inputs, "config": adaptors.FALLBACK_CONFIG}
29+
exp_kwargs = {
30+
"request": inputs,
31+
"config": adaptors.FALLBACK_CONFIG | {"collection_id": process_id},
32+
}
3033
exp_metadata = {"X-Forward-Process-ID": process_id}
3134

3235
request = adaptors.make_system_request(process_id, execution_content, resource)

0 commit comments

Comments
 (0)