Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-scripts/build_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _create_arg_parser() -> argparse.ArgumentParser:

def _write_path(file_contents: str, output_path: os.PathLike) -> None:
with open(output_path, "w") as file:
file.write(file_contents)
file.write(file_contents.replace('&', '&'))
file.write("\n")


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu,multi_platform_almalinux

login_banner_text='(bash-populate login_banner_text)'
read -r -d '' login_banner_text <<'EOF' || true
(bash-populate login_banner_text)
EOF

# Multiple regexes transform the banner regex into a usable banner
# 0 - Remove anchors around the banner text
Expand Down
2 changes: 1 addition & 1 deletion shared/macros/10-ansible.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ value: :code:`Setting={{ varname1 }}`

#}}
{{% macro ansible_deregexify_banner_etc_issue(banner_var_name) -%}}
{{ {{{ banner_var_name }}} |
{{ "{{{ banner_var_name }}}" |
{{{ ansible_deregexify_banner_anchors() }}} |
{{{ ansible_deregexify_multiple_banners() }}} |
{{{ ansible_deregexify_banner_space() }}} |
Expand Down
12 changes: 6 additions & 6 deletions ssg/build_remediations.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,20 +653,20 @@ def expand_xccdf_subs(fix, remediation_type):
fix_text
)

pattern = r'\(ansible-populate\s*(\S+)\)'
pattern = r'\(ansible-populate\s*([a-zA-Z0-9_]+)\)'

elif remediation_type == "puppet":
pattern = r'\(puppet-populate\s*(\S+)\)'
pattern = r'\(puppet-populate\s*([a-zA-Z0-9_]+)\)'

elif remediation_type == "anaconda":
pattern = r'\(anaconda-populate\s*(\S+)\)'
pattern = r'\(anaconda-populate\s*([a-zA-Z0-9_]+)\)'

elif remediation_type == "bash":
pattern = r'\(bash-populate\s*(\S+)\)'
pattern = r'\(bash-populate\s*([a-zA-Z0-9_]+)\)'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed? It doesn't change the generated data stream. Both old and new version of the shared.sh is matched by the old expression.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change isn't strictly needed but the old regex can get tripped up if the expression ends in )).

elif remediation_type == "kickstart":
pattern = r'\(kickstart-populate\s*(\S+)\)'
pattern = r'\(kickstart-populate\s*([a-zA-Z0-9_]+)\)'
elif remediation_type == "bootc":
pattern = r'\(bootc-populate\s*(\S+)\)'
pattern = r'\(bootc-populate\s*([a-zA-Z0-9_]+)\)'
else:
sys.stderr.write("Unknown remediation type '%s'\n" % (remediation_type))
sys.exit(1)
Expand Down
Loading