Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3457

Abort when trying to use {{.}} or {{{.}}} while not iterating

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.17.0, 3.15.4
    • Component/s: cf-agent
    • Labels:
      None
    • Story Points:
      3

      Description

      Core dump encountered while trying to render string from mustache template
      Trying to get:

      "one": True,"two": True,
      

      I expect this to work, but it doesn't:

      root@OH-WIN:/northern.tech/cfengine/core# cat test.cf
      bundle agent main
      {
        vars:
          "c" data => '[ "one", "two" ]';
          "c2" string => string_mustache( '"{{{.}}}": True,', c );
        reports:
          "$(c2)";
      }
      root@OH-WIN:/northern.tech/cfengine/core# /var/cfengine/bin/cf-agent -KI test.cf
      cf-promises: mustache.c:495: RenderVariable: Assertion `false' failed.
      Aborted
         error: Policy failed validation with command '"/var/cfengine/bin/cf-promises" -c "test.cf"'
         error: Failsafe condition triggered. Interactive session detected, skipping failsafe.cf execution.
         error: Error reading CFEngine policy. Exiting...
      root@OH-WIN:/northern.tech/cfengine/core#
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olehermanse Ole Herman Schumacher Elgesem
                Reporter:
                a10042 Nick Anderson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel