utils package

utils.add_kubernetes_rule module

class utils.add_kubernetes_rule.JinjaString[source]

Bases: str

utils.add_kubernetes_rule.clusterTestFunc(args)[source]
utils.add_kubernetes_rule.createNodeRuleFunc(args)[source]
utils.add_kubernetes_rule.createPlatformRuleFunc(args)[source]
utils.add_kubernetes_rule.createTestProfile(rule)[source]
utils.add_kubernetes_rule.create_base_rule(args, url=None, node_rule=False)[source]
utils.add_kubernetes_rule.jinja_string_representer(dumper, data)[source]
utils.add_kubernetes_rule.main()[source]
utils.add_kubernetes_rule.needs_oc(func)[source]
utils.add_kubernetes_rule.needs_working_cluster(func)[source]
utils.add_kubernetes_rule.save_rule(rule_yaml_path, rule_yaml)[source]
utils.add_kubernetes_rule.set_check_existence_value(value, template_vars)[source]
utils.add_kubernetes_rule.set_entity_value(value, template_vars)[source]
utils.add_kubernetes_rule.set_operation_value(value, template_vars)[source]
utils.add_kubernetes_rule.set_template_vars(value, template_vars)[source]
utils.add_kubernetes_rule.testFunc(args)[source]
utils.add_kubernetes_rule.which(program)[source]

utils.ansible_playbook_to_role module

class utils.ansible_playbook_to_role.PlaybookToRoleConverter(local_playbook_filename)[source]

Bases: object

PRODUCED_FILES = ('defaults/main.yml', 'meta/main.yml', 'tasks/main.yml', 'vars/main.yml', 'README.md')
property added_variables
property default_vars_data
property description_md
file(filepath)[source]
property name
property platform_version
property product
property profile
save_to_disk(directory)[source]
property tasks_data
property tasks_local_content
property title
property vars_data
class utils.ansible_playbook_to_role.RoleGithubUpdater(repo, local_playbook_filename)[source]

Bases: object

update_repository()[source]
utils.ansible_playbook_to_role.clone_and_init_repository(parent_dir, organization, repo)[source]
utils.ansible_playbook_to_role.create_empty_repositories(github_new_repos, github_org)[source]
utils.ansible_playbook_to_role.dict_constructor(loader, node)[source]
utils.ansible_playbook_to_role.dict_representer(dumper, data)[source]
utils.ansible_playbook_to_role.locally_clone_and_init_repositories(organization, repo_list)[source]
utils.ansible_playbook_to_role.main()[source]
utils.ansible_playbook_to_role.memoize(f)[source]
utils.ansible_playbook_to_role.parse_args()[source]
utils.ansible_playbook_to_role.select_roles_to_upload(product_allowlist, profile_allowlist, build_playbooks_dir)[source]
utils.ansible_playbook_to_role.update_repo_release(github, repo)[source]

utils.compare_ds module

utils.compare_ds.main()[source]
utils.compare_ds.parse_args()[source]

utils.create-stig-overlay module

utils.find_duplicates module

This script should find duplicates e.g. specific template is same as shared one

class utils.find_duplicates.BashDuplicatesFinder(root_dir, specific_dirs_mask, shared_dir, shared_files_mask='*.sh')[source]

Bases: DuplicatesFinder

class utils.find_duplicates.DuplicatesFinder(root_dir, specific_dirs_mask, shared_dir, shared_files_mask)[source]

Bases: object

search()[source]
Returns:

True if any duplicate found

class utils.find_duplicates.OvalDuplicatesFinder(root_dir, specific_dirs_mask, shared_dir, shared_files_mask='*.xml')[source]

Bases: DuplicatesFinder

utils.find_duplicates.main()[source]

main function

utils.find_duplicates.parse_args()[source]
utils.find_duplicates.recursive_globi(mask)[source]

Simple replacement of glob.globi(mask, recursive=true) Reason: Older Python versions support

utils.fix-rules module

utils.gen_tables module

class utils.gen_tables.HtmlOutput(product, build_dir)[source]

Bases: Output

get_result()[source]
class utils.gen_tables.JsonOutput(product, build_dir)[source]

Bases: Output

get_result()[source]
class utils.gen_tables.Output(product, build_dir)[source]

Bases: object

get_result()[source]
class utils.gen_tables.References[source]

Bases: object

handle_rule(rule_entry)[source]
handle_rule_ref_family(rule_name, family, ids)[source]
sorted()[source]
utils.gen_tables.parse_args()[source]

utils.generate_contributors module

utils.generate_contributors.main()[source]
utils.generate_contributors.parse_args()[source]

utils.ignition-remediation module

utils.mod_checks module

utils.mod_checks.add_platforms(rule_obj, platforms)[source]
utils.mod_checks.delete_ovals(rule_obj, products)[source]
utils.mod_checks.diff_ovals(rule_obj, products)[source]
utils.mod_checks.list_platforms(rule_obj)[source]
utils.mod_checks.main()[source]
utils.mod_checks.make_shared_oval(rule_obj, products)[source]
utils.mod_checks.parse_args()[source]
utils.mod_checks.remove_platforms(rule_obj, platforms)[source]
utils.mod_checks.replace_platforms(rule_obj, platforms)[source]

utils.mod_fixes module

utils.mod_fixes.add_platforms(rule_obj, lang, platforms)[source]
utils.mod_fixes.delete_fixes(rule_obj, lang, products)[source]
utils.mod_fixes.diff_fixes(rule_obj, lang, products)[source]
utils.mod_fixes.list_platforms(rule_obj, lang)[source]
utils.mod_fixes.main()[source]
utils.mod_fixes.make_shared_fix(rule_obj, lang, products)[source]
utils.mod_fixes.parse_args()[source]
utils.mod_fixes.remove_platforms(rule_obj, lang, platforms)[source]
utils.mod_fixes.replace_platforms(rule_obj, lang, platforms)[source]

utils.regexify_banner module

utils.regexify_banner.main()[source]
utils.regexify_banner.parse_args()[source]

utils.rule_dir_json module

utils.rule_dir_json.collect_rule_ids_and_dirs(rules_dir)[source]
utils.rule_dir_json.handle_ovals(product_list, product_yamls, rule_obj)[source]
utils.rule_dir_json.handle_remediations(product_list, product_yamls, rule_obj)[source]
utils.rule_dir_json.handle_rule_yaml(product_list, product_yamls, rule_id, rule_dir, guide_dir)[source]
utils.rule_dir_json.main()[source]
utils.rule_dir_json.parse_args()[source]
utils.rule_dir_json.quiet_print(msg, quiet, file)[source]
utils.rule_dir_json.walk_products(root, all_products)[source]

Module contents