From cf2ea46274a6c4115aad94ecc7c96dce64cab1a6 Mon Sep 17 00:00:00 2001 From: wei dong Date: Tue, 22 Feb 2022 10:29:55 +0800 Subject: [PATCH] Fix sos command failed in sos 4.0 Signed-off-by: wei dong (cherry picked from commit daff78541f9e07f9c8f0fcd44e661551b8c2db20) --- Fix-sos-command-failed-in-sos-4.0.patch | 46 +++++++++++++++++++++++++ sos.spec | 6 +++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 Fix-sos-command-failed-in-sos-4.0.patch diff --git a/Fix-sos-command-failed-in-sos-4.0.patch b/Fix-sos-command-failed-in-sos-4.0.patch new file mode 100644 index 0000000..89217e3 --- /dev/null +++ b/Fix-sos-command-failed-in-sos-4.0.patch @@ -0,0 +1,46 @@ +From e024511400e23d28b47c25df79ab162d8e1991ae Mon Sep 17 00:00:00 2001 +From: wei dong +Date: Tue, 22 Feb 2022 10:24:18 +0800 +Subject: [PATCH] Fix sos command failed in sos 4.0 + +Signed-off-by: wei dong +--- + sos/policies/uniontech.py | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +diff --git a/sos/policies/uniontech.py b/sos/policies/uniontech.py +index cd30136..535335b 100644 +--- a/sos/policies/uniontech.py ++++ b/sos/policies/uniontech.py +@@ -1,6 +1,3 @@ +-from __future__ import print_function +- +-from sos.plugins import RedHatPlugin + from sos.policies.redhat import RedHatPolicy, OS_RELEASE + import os + +@@ -10,11 +7,18 @@ class UnionTechPolicy(RedHatPolicy): + vendor = "the UnionTech Project" + vendor_url = "https://www.chinauos.com/" + +- def __init__(self, sysroot=None): +- super(UnionTechPolicy, self).__init__(sysroot=sysroot) ++ def __init__(self, sysroot=None, init=None, probe_runtime=True, ++ remote_exec=None): ++ super(UnionTechPolicy, self).__init__(sysroot=sysroot, init=init, ++ probe_runtime=probe_runtime, ++ remote_exec=remote_exec) + + @classmethod +- def check(cls): ++ def check(cls, remote=''): ++ ++ if remote: ++ return cls.distro in remote ++ + if not os.path.exists(OS_RELEASE): + return False + +-- +2.27.0 + diff --git a/sos.spec b/sos.spec index 178e581..3497010 100644 --- a/sos.spec +++ b/sos.spec @@ -2,7 +2,7 @@ Name: sos Version: 4.0 -Release: 4 +Release: 5 Summary: A set of tools to gather troubleshooting information from a system License: GPLv2+ URL: https://github.com/sosreport/sos @@ -11,6 +11,7 @@ Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz#/%{nam Patch6000: backport-Fix-dict-order-py38-incompatibility.patch Patch9000: openEuler-add-openEuler-policy.patch Patch9001: add-uniontech-os-support.patch +Patch9002: Fix-sos-command-failed-in-sos-4.0.patch BuildRequires: python3-devel gettext Requires: libxml2-python3 bzip2 xz python3-rpm tar python3-pexpect @@ -59,6 +60,9 @@ install -m 644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf %{_mandir}/man5/* %changelog +* Tue Feb 22 2022 weidong - 4.0-5 +- Fix sos command failed in sos 4.0 + * Mon Jul 19 2021 liugang - 4.0-4 - add UnionTech policy -- Gitee