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

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