From e5178a05c2a6a2032e1db5a5d2329b8b63862dcc Mon Sep 17 00:00:00 2001 From: xuezhixin Date: Mon, 13 Nov 2023 13:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=B3=BB=E7=BB=9F=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=92=8C=E7=B3=BB=E7=BB=9FID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sysmig_agent/Abisystmcompchk.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sysmig_agent/Abisystmcompchk.py b/sysmig_agent/Abisystmcompchk.py index f402a74..913fef1 100644 --- a/sysmig_agent/Abisystmcompchk.py +++ b/sysmig_agent/Abisystmcompchk.py @@ -528,3 +528,21 @@ def incomp_pkg_num(): tmp = line.split(',')[0] return num + +def system_version_id(): + fp = open('/etc/os-release', 'r') + for line in fp: + if 'VERSION_ID' in line: + break + fp.close() + return line.split('=', 1)[1].replace('"', '').replace('\n', '') + + +def get_cur_sys_version(): + fp = open('/etc/os-release', 'r') + for line in fp: + if 'PRETTY_NAME' in line: + break + fp.close() + return line.split('=', 1)[1].replace('"', '').replace('\n', '') + -- 2.20.1