Blame SOURCES/oscap-anaconda-addon-1.2.2-deep_archives-PR_168.patch

fa6af9
From 3377a914f4668af3d72216468ae192bc300890f9 Mon Sep 17 00:00:00 2001
fa6af9
From: Matej Tyc <matyc@redhat.com>
fa6af9
Date: Mon, 9 Aug 2021 15:45:58 +0200
fa6af9
Subject: [PATCH 1/2] Fix archive handling in GUI installs
fa6af9
fa6af9
GUI downloads an archive, so the ensuing installation doesn't have to.
fa6af9
However, the installation has to be able to discover files recovered
fa6af9
from the archive.
fa6af9
The fix makes sure that files are discovered also in subdirectories.
fa6af9
---
fa6af9
 org_fedora_oscap/content_discovery.py | 3 ++-
fa6af9
 1 file changed, 2 insertions(+), 1 deletion(-)
fa6af9
fa6af9
diff --git a/org_fedora_oscap/content_discovery.py b/org_fedora_oscap/content_discovery.py
fa6af9
index f6b4d27..5fc7343 100644
fa6af9
--- a/org_fedora_oscap/content_discovery.py
fa6af9
+++ b/org_fedora_oscap/content_discovery.py
fa6af9
@@ -196,7 +196,8 @@ def _gather_available_files(self, actually_fetched_content, dest_filename):
fa6af9
             if not dest_filename:  # using scap-security-guide
fa6af9
                 fpaths = [self.DEFAULT_SSG_DATA_STREAM_PATH]
fa6af9
             else:  # Using downloaded XCCDF/OVAL/DS/tailoring
fa6af9
-                fpaths = glob(str(self.CONTENT_DOWNLOAD_LOCATION / "*.xml"))
fa6af9
+                fpaths = pathlib.Path(self.CONTENT_DOWNLOAD_LOCATION).rglob("*")
fa6af9
+                fpaths = [str(p) for p in fpaths if p.is_file()]
fa6af9
         else:
fa6af9
             dest_filename = pathlib.Path(dest_filename)
fa6af9
             # RPM is an archive at this phase
fa6af9
fa6af9
From 191df327e3e51f486fb655e97acac30222c264fa Mon Sep 17 00:00:00 2001
fa6af9
From: Matej Tyc <matyc@redhat.com>
fa6af9
Date: Mon, 9 Aug 2021 15:48:50 +0200
fa6af9
Subject: [PATCH 2/2] Improve logging
fa6af9
fa6af9
Logs written to log files can contain specific details.
fa6af9
---
fa6af9
 org_fedora_oscap/ks/oscap.py | 2 +-
fa6af9
 1 file changed, 1 insertion(+), 1 deletion(-)
fa6af9
fa6af9
diff --git a/org_fedora_oscap/ks/oscap.py b/org_fedora_oscap/ks/oscap.py
fa6af9
index d1b8c9e..65d74cf 100644
fa6af9
--- a/org_fedora_oscap/ks/oscap.py
fa6af9
+++ b/org_fedora_oscap/ks/oscap.py
fa6af9
@@ -393,7 +393,7 @@ def _terminate(self, message):
fa6af9
                 time.sleep(100000)
fa6af9
 
fa6af9
     def _handle_error(self, exception):
fa6af9
-        log.error("Failed to fetch and initialize SCAP content!")
fa6af9
+        log.error(f"Failed to fetch and initialize SCAP content: {str(exception)}")
fa6af9
 
fa6af9
         if isinstance(exception, ContentCheckError):
fa6af9
             msg = _("The integrity check of the security content failed.")