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": [