代码拉取完成,页面将自动刷新
同步操作将从 anolis/leapp 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 09faa4508f1861e2845d8fd83f8700c061e12017 Mon Sep 17 00:00:00 2001
From: Chunmei Xu <xuchunmei@openanolis.org>
Date: Mon, 26 Jul 2021 19:32:16 +0800
Subject: [PATCH] add checkglibc
show changes about nis module and /etc/nsswitch.conf
Signed-off-by: Chunmei Xu <xuchunmei@openanolis.org>
---
.../el7toel8/actors/checkglibc/actor.py | 34 +++++++++++++++++++
.../tests/component_test_checkglibc.py | 33 ++++++++++++++++++
2 files changed, 67 insertions(+)
create mode 100644 repos/system_upgrade/el7toel8/actors/checkglibc/actor.py
create mode 100644 repos/system_upgrade/el7toel8/actors/checkglibc/tests/component_test_checkglibc.py
diff --git a/repos/system_upgrade/el7toel8/actors/checkglibc/actor.py b/repos/system_upgrade/el7toel8/actors/checkglibc/actor.py
new file mode 100644
index 0000000..145602f
--- /dev/null
+++ b/repos/system_upgrade/el7toel8/actors/checkglibc/actor.py
@@ -0,0 +1,34 @@
+from leapp.actors import Actor
+from leapp.libraries.common.rpms import has_package
+from leapp.models import InstalledRedHatSignedRPM
+from leapp.reporting import Report, create_report
+from leapp import reporting
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
+
+
+class CheckGlibc(Actor):
+ """
+ Show important changes of glibc
+ """
+
+ name = 'checkglibc'
+ consumes = (InstalledRedHatSignedRPM,)
+ produces = (Report,)
+ tags = (ChecksPhaseTag, IPUWorkflowTag)
+
+ def process(self):
+ if has_package(InstalledRedHatSignedRPM, 'glibc'):
+ create_report([
+ reporting.Title('Some important changes about glibc'),
+ reporting.Summary(
+ 'The GLIBC version of Anolis8 is 2.28. '
+ 'This version no longer supports nss related modules, '
+ 'no longer providing libnss_nis.so, libnss_nisplus.so. \n'
+ '/etc/nsswitch.conf deletes all configurations related to nis. '
+ 'The fast cache mechanism provided by the sssd can enhance the parsing performance of user and groups, '
+ '/etc/nsswitch.conf defaults to set the preferences for passwd and group for sss.\n'
+ 'All code that relies and uses the nis module requires rectification, you can use tirpc instead.'
+ ),
+ reporting.Severity(reporting.Severity.HIGH),
+ reporting.RelatedResource('package', 'glibc')
+ ])
diff --git a/repos/system_upgrade/el7toel8/actors/checkglibc/tests/component_test_checkglibc.py b/repos/system_upgrade/el7toel8/actors/checkglibc/tests/component_test_checkglibc.py
new file mode 100644
index 0000000..83780d8
--- /dev/null
+++ b/repos/system_upgrade/el7toel8/actors/checkglibc/tests/component_test_checkglibc.py
@@ -0,0 +1,33 @@
+from leapp.snactor.fixture import current_actor_context
+from leapp.models import InstalledRedHatSignedRPM, RPM
+from leapp.reporting import Report
+
+RH_PACKAGER = 'Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>'
+
+
+def create_modulesfacts(installed_rpm):
+ return InstalledRedHatSignedRPM(items=installed_rpm)
+
+
+def test_actor_with_glibc_package(current_actor_context):
+ with_glibc = [
+ RPM(name='glibc', version='2.28', release='1.sm01', epoch='1', packager=RH_PACKAGER, arch='noarch',
+ pgpsig='RSA/SHA256, Mon 01 Jan 1970 00:00:00 AM -03, Key ID 199e2f91fd431d51'),
+ RPM(name='powertop', version='0.1', release='1.sm01', epoch='1', packager=RH_PACKAGER, arch='noarch',
+ pgpsig='RSA/SHA256, Mon 01 Jan 1970 00:00:00 AM -03, Key ID 199e2f91fd431d51')]
+
+ current_actor_context.feed(create_modulesfacts(installed_rpm=with_glibc))
+ current_actor_context.run()
+ assert current_actor_context.consume(Report)
+
+
+def test_actor_without_glibc_package(current_actor_context):
+ without_glibc = [
+ RPM(name='powertop', version='0.1', release='1.sm01', epoch='1', packager=RH_PACKAGER, arch='noarch',
+ pgpsig='RSA/SHA256, Mon 01 Jan 1970 00:00:00 AM -03, Key ID 199e2f91fd431d51'),
+ RPM(name='sed', version='0.1', release='1.sm01', epoch='1', packager=RH_PACKAGER, arch='noarch',
+ pgpsig='RSA/SHA256, Mon 01 Jan 1970 00:00:00 AM -03, Key ID 199e2f91fd431d51')]
+
+ current_actor_context.feed(create_modulesfacts(installed_rpm=without_glibc))
+ current_actor_context.run()
+ assert not current_actor_context.consume(Report)
--
2.29.2
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。