File: net_usage_data-fix-missing-version_id-in-os-release.patch

package info (click to toggle)
buildbot 3.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 22,772 kB
  • sloc: python: 145,602; javascript: 11,856; sh: 1,020; makefile: 325
file content (25 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Robin Jarry <robin@jarry.cc>
Date: Thu, 5 Apr 2018 11:24:59 +0200
Subject: net_usage_data: fix missing version_id in os-release

When running on sid, the VERSION_ID field is not present in
/etc/os-release. Assume the default value is "unstable".

Signed-off-by: Robin Jarry <robin@jarry.cc>
---
 master/buildbot/buildbot_net_usage_data.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/master/buildbot/buildbot_net_usage_data.py b/master/buildbot/buildbot_net_usage_data.py
index 2620135..cecde85 100644
--- a/master/buildbot/buildbot_net_usage_data.py
+++ b/master/buildbot/buildbot_net_usage_data.py
@@ -43,7 +43,7 @@ PHONE_HOME_URL = "https://events.buildbot.net/events/phone_home"
 
 def linux_distribution():
     os_release = "/etc/os-release"
-    meta_data = {'ID': "unknown_linux", 'VERSION_ID': "unknown_version"}
+    meta_data = {'ID': "unknown_linux", 'VERSION_ID': "unstable"}
     if os.path.exists(os_release):
         with open("/etc/os-release", encoding='utf-8') as f:
             for line in f: