From 150a1dc560d5a4e37ca3d9013e9432d799f5e843 Mon Sep 17 00:00:00 2001 From: Luca Niccolini Date: Tue, 17 Mar 2020 11:39:25 -0700 Subject: [PATCH] VERSION_ID in /etc/os-release is not mandatory Summary: e.g. debian doesn't seem to have it ``` $ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux bullseye/sid" NAME="Debian GNU/Linux" ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" ``` Reviewed By: mjoras Differential Revision: D20483097 fbshipit-source-id: 722397ff994336884ed2e5bbf8fe517d4dcf4e6c --- build/fbcode_builder/getdeps/platform.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/fbcode_builder/getdeps/platform.py b/build/fbcode_builder/getdeps/platform.py index 5fc0c3c22..8c3d767e4 100644 --- a/build/fbcode_builder/getdeps/platform.py +++ b/build/fbcode_builder/getdeps/platform.py @@ -42,7 +42,11 @@ def get_linux_type(): name = re.sub("linux", "", name) name = name.strip() - return "linux", name, os_vars.get("VERSION_ID").lower() + version_id = os_vars.get("VERSION_ID") + if version_id: + version_id = version_id.lower() + + return "linux", name, version_id class HostType(object):