Compare commits

..

No commits in common. "577da94ac7e4fb4ee64d07555bb041b53ff7b04c" and "1b025d40a0670e0f4780f14a4ac85fadb9857576" have entirely different histories.

6 changed files with 41 additions and 131 deletions

Binary file not shown.

View File

@ -1,53 +0,0 @@
From 143db4a9516bd0e1c4c4b1e8a7aa91c04ee1699e Mon Sep 17 00:00:00 2001
From: jxy_git <jiangxinyu@kylinos.cn>
Date: Mon, 6 Nov 2023 17:31:38 +0800
Subject: [PATCH] add Kylin OS support
---
sos/policies/Kylin.py | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 sos/policies/Kylin.py
diff --git a/sos/policies/Kylin.py b/sos/policies/Kylin.py
new file mode 100644
index 0000000..dbbb229
--- /dev/null
+++ b/sos/policies/Kylin.py
@@ -0,0 +1,34 @@
+from sos.policies.redhat import RedHatPolicy, OS_RELEASE
+import os
+
+class KylinPolicy(RedHatPolicy):
+
+ distro = "Kylin Linux Advanced Server"
+ vendor = "Kylin"
+ vendor_urls = [
+ ('Distribution Website', 'https://www.kylinos.cn/'),
+ ('Vendor Website', 'https://www.kylinos.cn/')
+ ]
+
+ def __init__(self, sysroot=None, init=None, probe_runtime=True,
+ remote_exec=None):
+ super(KylinPolicy, self).__init__(sysroot=sysroot, init=init,
+ probe_runtime=probe_runtime,
+ remote_exec=remote_exec)
+
+ @classmethod
+ def check(cls, remote=''):
+
+ if remote:
+ return cls.distro in remote
+
+ 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 'Kylin Linux' in line:
+ return True
+ return False
+
--
2.33.0

View File

@ -1,49 +0,0 @@
From bf2a712488b3c980342293439400f5c4f476fa6c Mon Sep 17 00:00:00 2001
From: liuxingxiang <liuxingxiang@kylinsec.com.cn>
Date: Wed, 23 Feb 2022 09:39:22 +0800
Subject: [PATCH 1/1] add KylinSec OS support
---
sos/policies/KylinSec.py | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 sos/policies/KylinSec.py
diff --git a/sos/policies/KylinSec.py b/sos/policies/KylinSec.py
new file mode 100644
index 0000000..bf0b6f3
--- /dev/null
+++ b/sos/policies/KylinSec.py
@@ -0,0 +1,30 @@
+from sos.policies.redhat import RedHatPolicy, OS_RELEASE
+import os
+
+class KylinSecPolicy(RedHatPolicy):
+
+ distro = "KylinSec"
+ vendor = "KylinSec"
+ vendor_url = "http://www.kylinsec.com.cn/"
+
+ def __init__(self, sysroot=None, init=None, probe_runtime=True,
+ remote_exec=None):
+ super(KylinSecPolicy, self).__init__(sysroot=sysroot, init=init,
+ probe_runtime=probe_runtime,
+ remote_exec=remote_exec)
+
+ @classmethod
+ def check(cls, remote=''):
+
+ if remote:
+ return cls.distro in remote
+
+ 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 'KylinSec OS' in line:
+ return True
+ return False
--
2.27.0

View File

@ -0,0 +1,34 @@
From 1d7bab6c7ce3f78758113ca3cdf3e9fa1762df24 Mon Sep 17 00:00:00 2001
From: Eric Desrochers <eric.desrochers@canonical.com>
Date: Wed, 19 Aug 2020 17:44:07 -0400
Subject: [PATCH] [options] Fix dict order py38 incompatibility
python-3.8 dict changes introduce a traceback during our config file
parsing for options with `-` characters in them.
Fix this by changing an iteration of the dict keys from `dict.keys()`
that returns a dict_keys view, to `list(dict)` which returns a list copy
of the keys.
Closes: #2206
Resolves: #2207
Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
sos/options.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/options.py b/sos/options.py
index 3a2b4292f..ba3db1303 100644
--- a/sos/options.py
+++ b/sos/options.py
@@ -186,7 +186,7 @@ def _update_from_section(section, config):
if 'verbose' in odict.keys():
odict['verbosity'] = int(odict.pop('verbose'))
# convert options names
- for key in odict.keys():
+ for key in list(odict):
if '-' in key:
odict[key.replace('-', '_')] = odict.pop(key)
# set the values according to the config file

BIN
sos-4.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,23 +1,20 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: sos
Version: 4.5.6
Release: 3
Version: 4.0
Release: 5
Summary: A set of tools to gather troubleshooting information from a system
License: GPLv2+
URL: https://github.com/sosreport/sos
Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz
Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
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
Patch9003: add-KylinSec-OS-support.patch
Patch9004: add-Kylin-OS-support.patch
BuildRequires: python3-devel gettext
Requires: bzip2 xz python3-rpm tar python3-pexpect
Requires: python3-file-magic
Recommends: python3-pyyaml
Requires: libxml2-python3 bzip2 xz python3-rpm tar python3-pexpect
BuildArch: noarch
%description
@ -42,13 +39,9 @@ install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}/groups.d
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}/extras.d
install -m 644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
rm -rf ${RPM_BUILD_ROOT}/usr/config/
%find_lang %{name} || echo 0
# internationalization is currently broken. Uncomment this line once fixed.
#%%files -f %%{name}.lang
%files
%files -f %{name}.lang
%license LICENSE
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/sos/sos.conf
@ -67,21 +60,6 @@ rm -rf ${RPM_BUILD_ROOT}/usr/config/
%{_mandir}/man5/*
%changelog
* Fri Apr 11 2025 wangmian <wangmian@h-partners.com> - 4.5.6-3
- use python3-file-magic instead of python3-magic
* Mon Nov 06 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 4.5.6-2
- add Kylin policy
* Thu Jul 27 2023 dillon chen < dillon.chen@gmail.com> - 4.5.6-1
- update to 4.5.6
* Sun Oct 9 2022 dillon chen < dillon.chen@gmail.com> - 4.4-1
- update to 4.4
* Wed Feb 23 2022 liuxingxiang <liuxingxiang@kylinsec.com.cn> - 4.0-6
- add KylinSec policy
* Tue Feb 22 2022 weidong <weidong@uniontech.com> - 4.0-5
- Fix sos command failed in sos 4.0
@ -91,7 +69,7 @@ rm -rf ${RPM_BUILD_ROOT}/usr/config/
* Mon Mar 08 2021 shixuantong <shixuantong@huawei.com> - 4.0-3
- add openEuler policy
* Wed Mar 03 2021 shixuantong <shixuantong@huawei.com> - 4.0-2
* Tue Mar 03 2021 shixuantong <shixuantong@huawei.com> - 4.0-2
- fix unable to read configure file /etc/sos/sos.conf issue
* Tue Feb 02 2021 shixuantong <shixuantong@huawei.com> - 4.0-1