On 2/23/2010 12:00 PM, Devan Goodwin wrote:
As a result of my changes for remote snippetdir some behaviour has
changed for snippets containing un-escaped $ characters. Basically you
will see an unexpanded $SNIPPET() macro remaining in your final
kickstart file with 2.0.3.
This is related to a switch from using Cheetah's "#include $filename"
to a "#include source=$content", done to support remote snippetdirs
over http. (as obviously the snippet may no longer be on the local
filesystem) For some reason, including filenames is more forgiving
than the source method.
The workaround is to escape $'s (that aren't meant to be Cheetah
macros), or use #raw.
Two default snippets currently have every $ escaped but one,
partition_select and pre_partition_select.
After about a half dozen attempts to restore the old more forgiving
behaviour and keep remote snippets I've yet to find a way, but after
enough digging I'm going to now propose we:
1) Fix the default snippets with missing escapes.
2) Respin another 2.0.3.z RPM.
3) Keep the new behaviour, you'll have to escape $'s you don't want
Cheetah interpreting.
Based on the fact that virtually every $ in the default snippets are
escaped, and the comments here:
https://fedorahosted.org/cobbler/wiki/KickstartTemplating#Escaping, it
doesn't seem like this was reliable in the first place. Granted the
change in behaviour sucks, but I'm going to propose it may not be
worth the effort to restore.
Thoughts?
Devan
This email would have been fabulous to read two days ago when our
kickstarts stopped working after the upgrade ;-) Anyway, throwing #raw
... #end raw tags around stuff seems like the most elegant way to 'deal'
with the change. It's certainly cleaner for things like password hashes
than having an escape character in the hash. I also use these tags
frequently with config files, particularly ssh keys, ssl certs, etc.
However, one small bug we ran into that severely hampered our ability to
troubleshoot is the failure to print the parsing/cheetah error message
in lieu of the kickstart in many cases. I haven't exhaustively tested
behavior, but if there is an error in a file included as a snippet, the
snippet line in the original file is left instead of substituted.
--
Benjamin Riggs
System Staff
School of Mathematics
University of Minnesota
11 Vincent Hall
612-625-4895