Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix content_diff when a rule is removed #11855

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions ssg/content_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def _get_rules_to_compare(self, benchmark):
return rules

def compare_rules(self, old_benchmark, new_benchmark):
missing_rules = []
try:
rules_in_old_benchmark = self._get_rules_to_compare(old_benchmark)
except ValueError as e:
Expand All @@ -70,7 +69,6 @@ def compare_rules(self, old_benchmark, new_benchmark):
rule_id = old_rule.get_attr("id")
new_rule = new_benchmark.find_rule(rule_id)
if new_rule is None:
missing_rules.append(rule_id)
print("%s is missing in new data stream." % (rule_id))
continue
if self.only_rules:
Expand Down Expand Up @@ -315,7 +313,6 @@ def get_stig_rule_SV(self, sv_rule_id):
return stig_rule_id.group(1)

def compare_rules(self, old_benchmark, new_benchmark):
missing_rules = []
try:
rules_in_old_benchmark = self._get_rules_to_compare(old_benchmark)
rules_in_new_benchmark = self._get_rules_to_compare(new_benchmark)
Expand Down Expand Up @@ -347,7 +344,6 @@ def compare_existing_rules(self, new_benchmark, old_benchmark,
try:
new_sv_rule_id = new_rule_mapping[old_sv_rule_id]
except KeyError:
missing_rules.append(old_sv_rule_id)
print("%s is missing in new data stream." % old_stig_id)
continue
if self.only_rules:
Expand Down