File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131import json
3232import struct
3333import logging
34- import platform
3534
3635from collections import namedtuple
3736
5655logging .basicConfig (level = LOGLEVEL , format = '%(message)s' )
5756
5857
59- DIST , _ , _ = platform .linux_distribution ()
58+ def linux_distribution ():
59+ distro_id = 'Unknown'
60+ distro_version_id = ''
61+ with open ('/etc/os-release' ) as fd :
62+ for line in fd :
63+ name , _ , value = line .partition ('=' )
64+ if name == 'ID' :
65+ distro_id = value .strip ().strip ('"' )
66+ elif name == 'VERSION_ID' :
67+ distro_version_id = value .strip ().strip ('"' )
68+ return distro_id + distro_version_id
69+
70+
71+ DIST = linux_distribution ()
6072DATA = json .load (urlopen (USERSPACE_JSON ))
6173KCPLUS_DATA = json .load (urlopen (KCARE_PLUS_JSON ))
6274
@@ -261,6 +273,7 @@ def is_up_to_date(libname, build_id):
261273
262274def main ():
263275 failed = False
276+ logging .info ("Distro detected: %s" , DIST )
264277 for pid , libname , build_id in iter_proc_lib ():
265278 comm = get_comm (pid )
266279 logging .info ("For %s[%s] `%s` was found with buid id = %s" ,
You can’t perform that action at this time.
0 commit comments