Bug 2127940

Summary: save_to_file macro does not work if the thing being saved contains a heredoc terminated with EOF
Product: Red Hat Satellite Reporter: Peter Ondrejka <pondrejk>
Component: Provisioning TemplatesAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.12.0CC: aruzicka, mhulan, pcreech
Target Milestone: 6.12.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-3.3.0.17-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-16 13:35:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Ondrejka 2022-09-19 12:23:50 UTC
Description of problem:

save_to_file does

cat <<EOF >$file
$content
EOF

but if `$content` contains a heredoc terminated with `EOF`, it terminates the heredoc that save_to_file creates.


Version-Release number of selected component (if applicable):

Satellite 6.12 snap 11

How reproducible:
always

Additional info:
First found upstream by aruzicka

Comment 1 Bryan Kearney 2022-09-26 16:04:29 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35530 has been resolved.

Comment 2 Brad Buckingham 2022-10-04 13:53:39 UTC
Based upon discussion with QE and Eng (Adam), this bugzilla is needed in order to support the solution for bug 2127934.  For this reason, we are aligning it to 6.12.

Comment 6 Peter Ondrejka 2022-10-10 14:16:26 UTC
Verified on Sat 6.12 snap 14 using satqe automation.

Comment 10 errata-xmlrpc 2022-11-16 13:35:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8506