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

log actions do not work in insert_lines promises

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: 3.5.1, 3.12.2, 3.15.0b1
    • Fix Version/s: None
    • Component/s: Logging
    • Labels:
    • Platform:
      Linux

      Description

      Consider this example:

      body common control
      {
         bundlesequence => { "main", };
         inputs => { "libraries/cfengine_stdlib.cf", };
      }
      bundle agent main
      {
         methods:
            "any" usebundle => test;
            "any" usebundle => result;
      }
      bundle agent test
      {
         vars:
            "lines" slist => { "one", "two", "three" };
      
         files:
            "/tmp/foo"
               create        => "true",
               edit_defaults => empty,
               action        => log_repaired( "/tmp/promises", "foo repaired" ),
               edit_line     => myedit ( @{test.lines} );
      }
      bundle agent result
      {
         reports:
            promise_repaired_two::
               "two repaired";
      }
      bundle edit_line myedit ( l )
      {
         insert_lines:
            "${l}"
              classes => classes_generic( "${l}" ),
              action  => log_repaired( "/tmp/promises", "${l} repaired" );
      }
      

      Expected results:
      The file /tmp/foo is created.
      The file /tmp/promises contains entries from the files promise and the insert_lines promise.

      Actual results:
      The insert_lines entry in /tmp/promises is missing.

      neil@ettin ~/.cfagent/inputs $ rm /tmp/foo 
      neil@ettin ~/.cfagent/inputs $ rm /tmp/promises 
      neil@ettin ~/.cfagent/inputs $ cf-agent -f ./bug.cf
      2013-07-04T19:06:39-0400   notice: R: two repaired
      neil@ettin ~/.cfagent/inputs $ cat /tmp/foo 
      one
      two
      three
      neil@ettin ~/.cfagent/inputs $ cat /tmp/promises 
      Thu Jul  4 19:06:38 2013, foo repaired
      Thu Jul  4 19:06:38 2013, foo repaired
      
      neil@ettin ~/.cfagent/inputs $ cf-promises -V
      CFEngine Core 3.5.1.fbdb7b6
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              neilhwatson Neil Watson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel