From 046b160cfce6521c2a126cad267a2b43a54b50db Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
Date: Mon, 6 Jul 2015 15:01:15 +0200
Subject: [PATCH 8/9] Do not output redundant/invalid fields for the SSG
content (#1240285)
The SSG content is specific and it doesn't require xccdf-path nor content-url
fields in the kickstart. Thus we should avoid putting them into the output that
may be later used as an input for more installations.
Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
---
org_fedora_oscap/ks/oscap.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/org_fedora_oscap/ks/oscap.py b/org_fedora_oscap/ks/oscap.py
index d0c39b8..475aa2c 100644
--- a/org_fedora_oscap/ks/oscap.py
+++ b/org_fedora_oscap/ks/oscap.py
@@ -108,13 +108,14 @@ class OSCAPdata(AddonData):
ret = "%%addon %s" % self.name
ret += "\n%s" % key_value_pair("content-type", self.content_type)
- ret += "\n%s" % key_value_pair("content-url", self.content_url)
+ if self.content_url:
+ ret += "\n%s" % key_value_pair("content-url", self.content_url)
if self.datastream_id:
ret += "\n%s" % key_value_pair("datastream-id", self.datastream_id)
if self.xccdf_id:
ret += "\n%s" % key_value_pair("xccdf-id", self.xccdf_id)
- if self.xccdf_path:
+ if self.xccdf_path and self.content_type != "scap-security-guide":
ret += "\n%s" % key_value_pair("xccdf-path", self.xccdf_path)
if self.cpe_path:
ret += "\n%s" % key_value_pair("cpe-path", self.cpe_path)
--
2.4.3