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

mustache and inline_mustache files promises should not error if `create => "false"` is specified and file does not exist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 3.20.0
    • Fix Version/s: 3.20.0
    • Component/s: cf-agent
    • Labels:
    • Story Points:
      2

      Description

      mustache and inline_mustache files promises should not error if `create => "false"` is specified and file does not exist

      root@hub:~# cat ~/mustache.cf 
      bundle agent __main__
      {
        vars:
            "template_data"
              data => '{ "name": "Lars" }';
      
        files:
            "/tmp/edit_template"
              content => "Hello {{{name}}}!$(const.n)";
      
            "/tmp/test_1"
              create => "false",
              template_method => "mustache",
              edit_template => "/tmp/valid_edit_template",
              template_data => @(template_data);
      }
      
      root@hub:~# cf-agent -KIf ~/mustache.cf 
          info: Created file '/tmp/edit_template', mode 0600
          info: Updated content of '/tmp/edit_template' with content 'Hello {{{name}}}!
      '
         error: Promised to edit '/tmp/test_1', but file does not exist
         error: Errors encountered when actuating files promise '/tmp/test_1'
      

       

        Attachments

          Activity

            People

            Assignee:
            larsewi Lars Erik Wik
            Reporter:
            larsewi Lars Erik Wik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: