From 9d1cc3ea758ed0e2d38339a40bed448565959472 Mon Sep 17 00:00:00 2001 From: cherry530 <707078654@qq.com> Date: Mon, 25 Nov 2024 16:01:12 +0800 Subject: [PATCH] fix name cockpit_present is not defined. Signed-off-by: cherry530 <707078654@qq.com> (cherry picked from commit 1fd3cc3ed559ca9cade375c61b4f58088421960f) --- 389-ds-base.spec | 6 ++- remove-where-cockpit_present-is-called.patch | 47 ++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 remove-where-cockpit_present-is-called.patch diff --git a/389-ds-base.spec b/389-ds-base.spec index 18f669a..683bb78 100644 --- a/389-ds-base.spec +++ b/389-ds-base.spec @@ -6,7 +6,7 @@ ExcludeArch: i686 Name: 389-ds-base Summary: Base 389 Directory Server Version: 3.1.1 -Release: 1 +Release: 2 License: GPLv3+ URL: https://www.port389.org Source0: https://releases.pagure.org/389-ds-base/389-ds-base-%{version}.tar.bz2 @@ -15,6 +15,7 @@ Source2: 389-ds-base-devel.README # Refer: https://github.com/389ds/389-ds-base/pull/5374 Patch0: fix-dsidm-posixgroup-get_dn-fails-with-search_ext.patch +Patch1: remove-where-cockpit_present-is-called.patch BuildRequires: nspr-devel nss-devel >= 3.34 perl-generators openldap-devel libdb-devel cyrus-sasl-devel icu BuildRequires: libicu-devel pcre-devel cracklib-devel gcc-c++ net-snmp-devel lm_sensors-devel bzip2-devel @@ -321,6 +322,9 @@ exit 0 %{_mandir}/*/* %changelog +* Mon Nov 25 2024 xu_ping <707078654@qq.com> - 3.1.1-2 +- fix name cockpit_present is not defined. + * Thu Aug 01 2024 yaoxin - 3.1.1-1 - Update to 3.1.1 * Security fix for CVE-2024-6237,CVE-2024-5953,CVE-2024-3657,CVE-2024-2199 diff --git a/remove-where-cockpit_present-is-called.patch b/remove-where-cockpit_present-is-called.patch new file mode 100644 index 0000000..463e37c --- /dev/null +++ b/remove-where-cockpit_present-is-called.patch @@ -0,0 +1,47 @@ +From d1f5ab91be74f0c599e619d2ffbf5aa59d389e7c Mon Sep 17 00:00:00 2001 +From: cherry530 <707078654@qq.com> +Date: Mon, 25 Nov 2024 15:38:27 +0800 +Subject: [PATCH] Remove where cockpit_present is called + +Signed-off-by: cherry530 <707078654@qq.com> +--- + src/lib389/lib389/cli_ctl/cockpit.py | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/src/lib389/lib389/cli_ctl/cockpit.py b/src/lib389/lib389/cli_ctl/cockpit.py +index afc7247..13a3eae 100644 +--- a/src/lib389/lib389/cli_ctl/cockpit.py ++++ b/src/lib389/lib389/cli_ctl/cockpit.py +@@ -27,9 +27,6 @@ def open_firewall(inst, log, args): + """ + Open the firewall for Cockpit service + """ +- if not cockpit_present(): +- raise ValueError("The 'cockpit' package is not installed on this system") +- + OPEN_CMD = ['sudo', 'firewall-cmd', '--add-service=cockpit', '--permanent'] + if args.zone is not None: + OPEN_CMD.append(f' --zone={args.zone}') +@@ -43,9 +40,6 @@ def disable_cockpit(inst, log, args): + """ + Disable Cockpit socket + """ +- if not cockpit_present(): +- raise ValueError("The 'cockpit' package is not installed on this system") +- + DISABLE_CMD = ['sudo', 'systemctl', 'disable', '--now', 'cockpit.socket'] + try: + subprocess.run(DISABLE_CMD) +@@ -57,9 +51,6 @@ def close_firewall(inst, log, args): + """ + Close firewall for Cockpit service + """ +- if not cockpit_present(): +- raise ValueError("The 'cockpit' package is not installed on this system") +- + CLOSE_CMD = ['sudo', 'firewall-cmd', '--remove-service=cockpit', '--permanent'] + try: + subprocess.run(CLOSE_CMD) +-- +2.43.0 + -- Gitee