From 81d7eedea0d227392f6231a8d1a05ff4d4990488 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Fri, 18 Oct 2024 18:11:55 +0200 Subject: [PATCH] fix(cachi2): processing of env vars Fixing format of envvars, Cachi2 have slightly different format Signed-off-by: Martin Basti --- atomic_reactor/utils/cachi2.py | 2 +- tests/utils/test_cachi2.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/atomic_reactor/utils/cachi2.py b/atomic_reactor/utils/cachi2.py index cc6f2c540..016ff9c55 100644 --- a/atomic_reactor/utils/cachi2.py +++ b/atomic_reactor/utils/cachi2.py @@ -144,7 +144,7 @@ def generate_request_json( "pkg_managers": remote_source.get("pkg_managers", []), "ref": remote_source["ref"], "repo": remote_source["repo"], - "environment_variables": {key: val["value"] for key, val in remote_source_env_json.items()}, + "environment_variables": {env['name']: env["value"] for env in remote_source_env_json}, "flags": remote_source.get("flags", []), "packages": [], # this will be always empty cachi2 doesn't provide nested deps } diff --git a/tests/utils/test_cachi2.py b/tests/utils/test_cachi2.py index 363db0df8..b3d61916d 100644 --- a/tests/utils/test_cachi2.py +++ b/tests/utils/test_cachi2.py @@ -394,12 +394,12 @@ def test_generate_request_json(): ], } - remote_source_env_json = { - "GOCACHE": { - "kind": "path", - "value": "deps/gomod" + remote_source_env_json = [ + { + "name":"GOCACHE", + "value": "deps/gomod", }, - } + ] expected = { "dependencies": [