From 241cac43e78818c25e3c735108462390e12418b4 Mon Sep 17 00:00:00 2001 From: Jan Rodak Date: Tue, 20 Feb 2024 12:58:22 +0100 Subject: [PATCH] Disable build of OCIL for thin DS --- build-scripts/build_xccdf.py | 4 ++++ ssg/build_yaml.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/build-scripts/build_xccdf.py b/build-scripts/build_xccdf.py index 1e0feb4f6058..5bfe48fc138e 100644 --- a/build-scripts/build_xccdf.py +++ b/build-scripts/build_xccdf.py @@ -107,6 +107,8 @@ def link_benchmark_per_profile(loader, args): if not os.path.exists(args.per_profile_dir): os.makedirs(args.per_profile_dir) + loader.off_ocil = True + for id_, benchmark in loader.get_benchmark_by_profile(): xccdftree = benchmark.to_xml_element(loader.env_yaml) p = Paths_( @@ -117,6 +119,8 @@ def link_benchmark_per_profile(loader, args): ) link_benchmark(loader, xccdftree, p, benchmark) + loader.off_ocil = False + def main(): args = parse_args() diff --git a/ssg/build_yaml.py b/ssg/build_yaml.py index 015c1b797930..519752523250 100644 --- a/ssg/build_yaml.py +++ b/ssg/build_yaml.py @@ -1464,6 +1464,7 @@ def __init__(self, env_yaml, resolved_path): self.benchmark = None self.env_yaml = env_yaml self.product_cpes = ProductCPEs() + self.off_ocil = False def find_first_groups_ids(self, start_dir): group_files = glob.glob(os.path.join(start_dir, "*", "group.yml")) @@ -1568,6 +1569,8 @@ def _get_rules_from_benchmark(self, benchmark): return [self.rules[rule_id] for rule_id in benchmark.get_rules_selected_in_all_profiles()] def export_ocil_to_xml(self, benchmark=None): + if self.off_ocil: + return None root = self._create_ocil_xml_skeleton() if benchmark is None: