Blob Blame History Raw
From 28aa3ea6325b43e6a12815457f431a49167898e3 Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
Date: Tue, 4 Aug 2015 10:52:11 +0200
Subject: [PATCH 4/7] Test preinst_content_path before raw_preinst_content_path
 (#1249937)

If the SSG content is used, the content is already prepared for processing and
thus there's already valid content on the preinst_content_path so we need to
check for that before using the check of raw_preinst_content_path to decide
whether content download is needed or not.

Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
---
 org_fedora_oscap/gui/spokes/oscap.py | 1 +
 org_fedora_oscap/ks/oscap.py         | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/org_fedora_oscap/gui/spokes/oscap.py b/org_fedora_oscap/gui/spokes/oscap.py
index 7037f91..33b97c0 100644
--- a/org_fedora_oscap/gui/spokes/oscap.py
+++ b/org_fedora_oscap/gui/spokes/oscap.py
@@ -1039,6 +1039,7 @@ class OSCAPSpoke(NormalSpoke):
         self.refresh()
 
     def on_use_ssg_clicked(self, *args):
+        self._addon_data.clear_all()
         self._addon_data.content_type = "scap-security-guide"
         self._addon_data.xccdf_path = common.SSG_DIR + common.SSG_XCCDF
         self._fetch_data_and_initialize()
diff --git a/org_fedora_oscap/ks/oscap.py b/org_fedora_oscap/ks/oscap.py
index 8352236..c17a1ad 100644
--- a/org_fedora_oscap/ks/oscap.py
+++ b/org_fedora_oscap/ks/oscap.py
@@ -409,7 +409,7 @@ class OSCAPdata(AddonData):
             # selected
             return
 
-        if not os.path.exists(self.raw_preinst_content_path):
+        if not os.path.exists(self.preinst_content_path) and not os.path.exists(self.raw_preinst_content_path):
             # content not available/fetched yet
             try:
                 self._fetch_content_and_initialize()
-- 
2.1.0