Skip to content

Commit 2dd62f1

Browse files
committed
Fail fast on missing DISTRO and map focal/jammy to ubuntu20/ubuntu22
1 parent 1e5c941 commit 2dd62f1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

RAMP/module_metadata.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ def _read_key_value_file(path):
115115
def get_curr_os():
116116
global RLEC_OS_MAP
117117
if os.path.exists(DEVCONTAINER_PATH):
118-
devcontainer_os = _read_key_value_file(DEVCONTAINER_PATH).get("DISTRO")
119-
if devcontainer_os:
120-
return devcontainer_os
121-
118+
devcontainer_os = _read_key_value_file(DEVCONTAINER_PATH)["DISTRO"]
119+
return (devcontainer_os
120+
.replace("focal", "ubuntu20")
121+
.replace("jammy", "ubuntu22"))
122122
curr_os = '%s%s' % (distro.id(), distro.version_parts()[0])
123123
rlec_os = RLEC_OS_MAP.get(curr_os, curr_os)
124124
return rlec_os

0 commit comments

Comments
 (0)