Skip to content

Commit

Permalink
Allow populating one content type by more means
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed Jun 30, 2023
1 parent fde8ce6 commit f215139
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions build-scripts/generate_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
from ssg import build_yaml


RULE_CONTENT_FILES = dict(
ansible="fixes/ansible/{id}.yml",
bash="fixes/bash/{id}.sh",
oval="checks/oval/{id}.xml",
RULE_CONTENT_FILES = (
("ansible", "fixes/ansible/{id}.yml"),
("bash", "fixes/bash/{id}.sh"),
("oval", "checks/oval/{id}.xml"),
("oval", "checks_from_templates/oval/{id}.xml"),
)

RULE_ATTRIBUTES = dict(
Expand Down Expand Up @@ -42,7 +43,7 @@ def add_rule_attributes(main_dir, output_dict, rule_id):

def add_rule_associated_content(main_dir, output_dict, rule_id):
contents = set()
for content_id, expected_filename_template in RULE_CONTENT_FILES.items():
for content_id, expected_filename_template in RULE_CONTENT_FILES:
expected_filename = os.path.join(main_dir, expected_filename_template.format(id=rule_id))
if os.path.exists(expected_filename):
contents.add(content_id)
Expand Down

0 comments on commit f215139

Please sign in to comment.