Description of problem: hen you use escape '\' characters in the pre/post scripts section (kickstart file management), the editor does not put these into the resulting kickstart file. Editor should put text in verbatim, similar to what it in Satellite 5.2. Version-Release number of selected component (if applicable): Red Hat Network (RHN) Satellite 5.3.0 System architecture(s): RHEL 5.4 x86_64 How reproducible: Always. Steps to Reproduce: 1. Create a new kickstart profile 2. Go to the scripts tab for the new profile and add a new %pre or %post script with the contents: echo "\\$zoom \$zoom $zoom" 3. Select the "Kickstart File" tab and scroll down Actual results: echo "\$zoom $zoom $zoom" Notice that a single escape character has been removed before each dollar-sign. Expected results: echo "\\$zoom \$zoom $zoom" Additional info from customer: [snip] Since these scripts do not use templating, Satellite is wrapping them in Cheetah #raw directives. The Cheetah User Guide says that text inside a #raw .. #end raw tag pair will be printed verbatim. I've narrowed this down to a bug in the way Cheetah handles its #raw directives, as can be seen here: Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> t = """#raw ... This escape should be preserved: \\$unexpanded ... So should this one: \\#blah ... The string "\\012" should not disappear. #end raw""" >>> print t #raw This escape should be preserved: \$unexpanded So should this one: \#blah The string "\012" should not disappear. #end raw >>> import Cheetah.Template >>> print Cheetah.Template.Template ( t, [ { "unexpanded" : "EXPANDED" } ] ) This escape should be preserved: $unexpanded So should this one: #blah The string "" should not disappear. >>> I have proposed the attached patches (0001-Move-escaped-vars-to-parser.patch and 0002-split-multiline-at-repr-breaks.patch) upstream to resolve the issue. If accepted, they will need to be back-ported. [snip] Impact to the customer: high - all the kickstart profiles the client currently has are rolling out incorrect ks files, which is doing bad things
Per confirmation with Justin, the content within #raw...#endraw should not be escaped.
Created attachment 379937 [details] combined/ported patch for 5.3.0 satellite
Looks like this was accepted upstream. Going ahead and patching the version we ship for Satellite 5.3 http://sourceforge.net/mailarchive/message.php?msg_name=1260840969-3603-1-git-send-email-karmix0@gmail.com
K, I updated our internal build of cheetah to use the patch.
commit in thirdparty git: 2e9a1091d18d507864cfe108a31bf8824b3d0390
commit in third party git (ignore that last one): 264961c4d056cd364812255714424e9b7ddf6e0d
# VERIFIED Checked against archs: i386, x86_64, s390x the pre/post script containing escape characters are not getting removed now. Packages fixing the issue: --- python-cheetah-2.0.1-1 cobbler-1.6.6-5 spacewalk-web-0.5.23-34 spacewalk-java-0.5.44-74 spacewalk-backend-0.5.28-40.x.2 ---
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0369.html