1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-07 07:02:53 +03:00

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
This commit is contained in:
Luca Niccolini
2020-03-17 11:39:25 -07:00
committed by Facebook GitHub Bot
parent a41f47300f
commit 150a1dc560

View File

@@ -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):