From 96a613184b4c6ab19d0a1ea2363041d4319efbec Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Wed, 18 Aug 2021 18:38:58 +0000 Subject: [PATCH] import oscap-anaconda-addon-1.2.1-2.el8 --- ...nda-addon-1.2.2-content_ident-PR_167.patch | 39 +++++++++++++++++++ SPECS/oscap-anaconda-addon.spec | 8 +++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 SOURCES/oscap-anaconda-addon-1.2.2-content_ident-PR_167.patch diff --git a/SOURCES/oscap-anaconda-addon-1.2.2-content_ident-PR_167.patch b/SOURCES/oscap-anaconda-addon-1.2.2-content_ident-PR_167.patch new file mode 100644 index 0000000..7e73e03 --- /dev/null +++ b/SOURCES/oscap-anaconda-addon-1.2.2-content_ident-PR_167.patch @@ -0,0 +1,39 @@ +From 1abc4e96638e819d3fbee74396b36a6ccaf0ab29 Mon Sep 17 00:00:00 2001 +From: Matej Tyc +Date: Tue, 3 Aug 2021 11:01:59 +0200 +Subject: [PATCH] Refactor content identification + +Don't use the multiprocessing pool - it sometimes creates probems during +its initialization: +https://bugzilla.redhat.com/show_bug.cgi?id=1989441 +--- + org_fedora_oscap/content_handling.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/org_fedora_oscap/content_handling.py b/org_fedora_oscap/content_handling.py +index f2af22f..65d5a28 100644 +--- a/org_fedora_oscap/content_handling.py ++++ b/org_fedora_oscap/content_handling.py +@@ -111,9 +111,8 @@ def parse_HTML_from_content(content): + + + def identify_files(fpaths): +- with multiprocessing.Pool(os.cpu_count()) as p: +- labels = p.map(get_doc_type, fpaths) +- return {path: label for (path, label) in zip(fpaths, labels)} ++ result = {path: get_doc_type(path) for path in fpaths} ++ return result + + + def get_doc_type(file_path): +@@ -131,7 +130,9 @@ def get_doc_type(file_path): + except UnicodeDecodeError: + # 'oscap info' supplied weird output, which happens when it tries + # to explain why it can't examine e.g. a JPG. +- return None ++ pass ++ except Exception as e: ++ log.warning(f"OSCAP addon: Unexpected error when looking at {file_path}: {str(e)}") + log.info("OSCAP addon: Identified {file_path} as {content_type}" + .format(file_path=file_path, content_type=content_type)) + return content_type diff --git a/SPECS/oscap-anaconda-addon.spec b/SPECS/oscap-anaconda-addon.spec index fac18ec..af5cdbc 100644 --- a/SPECS/oscap-anaconda-addon.spec +++ b/SPECS/oscap-anaconda-addon.spec @@ -3,7 +3,7 @@ Name: oscap-anaconda-addon Version: 1.2.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Anaconda addon integrating OpenSCAP to the installation process License: GPLv2+ @@ -19,6 +19,7 @@ Source0: %{name}-%{version}.tar.gz # Let the Patch1 be reserved for translations patches Patch1: lang.patch +Patch2: oscap-anaconda-addon-1.2.2-content_ident-PR_167.patch BuildArch: noarch BuildRequires: make @@ -45,6 +46,7 @@ content. # As patches may translates the strings that are updated by later patches, # Patch1 needs to be aplied last. %patch1 -p1 +%patch2 -p1 # NOTE CONCERNING TRANSLATION PATCHES # When preparing translation patches, don't consider that some languages are unsupported - # we aim to include all applicable translation texts to the appropriate patch. @@ -66,6 +68,10 @@ make install DESTDIR=%{buildroot} %doc COPYING ChangeLog README.md %changelog +* Tue Aug 03 2021 Matej Tyc - 1.2.1-2 +- Refactor content identification +- Resolves: rhbz#1989441 + * Fri Jul 30 2021 Matej Tyc - 1.2.1-1 - Rebase to the new upstream version. - Resolves: rhbz#1691305