import oscap-anaconda-addon-1.2.1-2.el8
This commit is contained in:
parent
1bbea3e845
commit
96a613184b
@ -0,0 +1,39 @@
|
|||||||
|
From 1abc4e96638e819d3fbee74396b36a6ccaf0ab29 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matej Tyc <matyc@redhat.com>
|
||||||
|
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
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: oscap-anaconda-addon
|
Name: oscap-anaconda-addon
|
||||||
Version: 1.2.1
|
Version: 1.2.1
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: Anaconda addon integrating OpenSCAP to the installation process
|
Summary: Anaconda addon integrating OpenSCAP to the installation process
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@ -19,6 +19,7 @@ Source0: %{name}-%{version}.tar.gz
|
|||||||
|
|
||||||
# Let the Patch1 be reserved for translations patches
|
# Let the Patch1 be reserved for translations patches
|
||||||
Patch1: lang.patch
|
Patch1: lang.patch
|
||||||
|
Patch2: oscap-anaconda-addon-1.2.2-content_ident-PR_167.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
@ -45,6 +46,7 @@ content.
|
|||||||
# As patches may translates the strings that are updated by later patches,
|
# As patches may translates the strings that are updated by later patches,
|
||||||
# Patch1 needs to be aplied last.
|
# Patch1 needs to be aplied last.
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
# NOTE CONCERNING TRANSLATION PATCHES
|
# NOTE CONCERNING TRANSLATION PATCHES
|
||||||
# When preparing translation patches, don't consider that some languages are unsupported -
|
# When preparing translation patches, don't consider that some languages are unsupported -
|
||||||
# we aim to include all applicable translation texts to the appropriate patch.
|
# 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
|
%doc COPYING ChangeLog README.md
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 03 2021 Matej Tyc <matyc@redhat.com> - 1.2.1-2
|
||||||
|
- Refactor content identification
|
||||||
|
- Resolves: rhbz#1989441
|
||||||
|
|
||||||
* Fri Jul 30 2021 Matej Tyc <matyc@redhat.com> - 1.2.1-1
|
* Fri Jul 30 2021 Matej Tyc <matyc@redhat.com> - 1.2.1-1
|
||||||
- Rebase to the new upstream version.
|
- Rebase to the new upstream version.
|
||||||
- Resolves: rhbz#1691305
|
- Resolves: rhbz#1691305
|
||||||
|
Loading…
Reference in New Issue
Block a user