Details
-
Type:
Bug
-
Status: Done
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 3.17.0
-
Labels:None
-
Story Points:3
Description
I get an assertion while trying to render a mustache template.
string_mustache
bundle agent firewall { vars: "_defaults" data => '{ "source": "0.0.0.0/0", "protocol": "tcp" }'; "cfengine" data => mergedata( @(_defaults), '{"name": "cfengine" "destination-port": "5308" }' ); "RULES" data => mergedata( '{ "ACCEPT": [ cfengine ]}' ); reports: "$(with)" with => string_mustache( "{{#ACCEPT}}{{.}}{{/ACCEPT}}", RULES ); } bundle agent __main__ { methods: "firewall"; reports: "CFEngine $(sys.cf_version)"; }
cf-agent: mustache.c:495: RenderVariable: Assertion `false' failed.
inline_mustache
bundle agent firewall { vars: "_defaults" data => '{ "source": "0.0.0.0/0", "protocol": "tcp" }'; "cfengine" data => mergedata( @(_defaults), '{"name": "cfengine" "destination-port": "5308" }' ); "RULES" data => mergedata( '{ "ACCEPT": [ cfengine ]}' ); files: "/tmp/file.txt" create => "true", template_method => "inline_mustache", edit_template_string => "{{#ACCEPT}}{{.}}{{/ACCEPT}}", template_data => @(RULES); } bundle agent __main__ { methods: "firewall"; reports: "CFEngine $(sys.cf_version)"; }
info: Created file '/tmp/file.txt', mode 0600 cf-agent: mustache.c:495: RenderVariable: Assertion `false' failed.
Attachments
Issue Links
- relates to
-
CFE-3457 Abort when trying to use {{.}} or {{{.}}} while not iterating
-
- Done
-