Commit 1e93e64f authored by Luca Niccolini's avatar Luca Niccolini Committed by Facebook GitHub Bot

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
parent 72f1c293
...@@ -42,7 +42,11 @@ def get_linux_type(): ...@@ -42,7 +42,11 @@ def get_linux_type():
name = re.sub("linux", "", name) name = re.sub("linux", "", name)
name = name.strip() 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): class HostType(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment