diff --git a/add-uniontech-os-support.patch b/add-uniontech-os-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..4a80f1f578a7287a05436c0aa971eb4bb6b112ab --- /dev/null +++ b/add-uniontech-os-support.patch @@ -0,0 +1,45 @@ +From d6c8127444420658e3f51d9d8af248b39b6acb19 Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 19 Jul 2021 16:12:02 +0800 +Subject: [PATCH] add uniontech os support + +--- + sos/policies/uniontech.py | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + create mode 100644 sos/policies/uniontech.py + +diff --git a/sos/policies/uniontech.py b/sos/policies/uniontech.py +new file mode 100644 +index 0000000..cd30136 +--- /dev/null ++++ b/sos/policies/uniontech.py +@@ -0,0 +1,26 @@ ++from __future__ import print_function ++ ++from sos.plugins import RedHatPlugin ++from sos.policies.redhat import RedHatPolicy, OS_RELEASE ++import os ++ ++class UnionTechPolicy(RedHatPolicy): ++ ++ distro = "UnionTech" ++ vendor = "the UnionTech Project" ++ vendor_url = "https://www.chinauos.com/" ++ ++ def __init__(self, sysroot=None): ++ super(UnionTechPolicy, self).__init__(sysroot=sysroot) ++ ++ @classmethod ++ def check(cls): ++ if not os.path.exists(OS_RELEASE): ++ return False ++ ++ with open(OS_RELEASE, 'r') as f: ++ for line in f: ++ if line.startswith('NAME'): ++ if 'UnionTech' in line: ++ return True ++ return False +-- +2.23.0 + diff --git a/sos.spec b/sos.spec index 04e14964ef9ea51107024be12fd4193106e0ecac..23b574b2d055a2bb5ad4a5bcb98e6807e9d765fe 100644 --- a/sos.spec +++ b/sos.spec @@ -2,7 +2,7 @@ Name: sos Version: 3.6 -Release: 6 +Release: 7 Summary: A set of tools to gather troubleshooting information from a system License: GPLv2+ URL: http://github.com/sosreport/sos @@ -26,6 +26,7 @@ Patch6009: backport-archive-remove-unused-copy-arg-from-FileCacheArchive.patch Patch6010: backport-archive-fix-local-variable-name-in-FileCacheArchive.patch Patch9000: openEuler-add-openEuler-policy.patch +Patch9001: add-uniontech-os-support.patch %description Sos is an extensible, portable, support data collection tool primarily @@ -59,6 +60,9 @@ install -Dm644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf %{_mandir}/man5/sos.conf.5.gz %changelog +* Tue Jul 20 2021 liugang - 3.6-7 +- add UnionTech policy + * Tue May 11 2021 shixuantong - 3.6-6 - add openEuler policy and fix exception in plugin method "yum.collect()"