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

Warning should not be emitted when files content attribute used without create attribute

    XMLWordPrintable

    Details

    • Story Points:
      1

      Description

      When a file is promised using the content attribute, the file is created if necessary as expected with the expected content. However, there is a warning emitted that no action was requested. I did not expect the warning to be emitted as the content attribute implies create => true.

       bundle agent main
       {
         files:
             "/tmp/example.txt" content => "hello there";
      
      }
      
      # cf-agent --no-lock --log-level info --file /tmp/example.cf
          info: Updated content of '/tmp/example.txt' with content 'hello there'
       warning: No action was requested for file '/tmp/example.txt'. Maybe a typo in the policy?
          info: files promise '/tmp/example.txt' repaired

      BUG, no action requested for file ... but the file was created:

      Shell command with stderr
      cat /tmp/example.txt; rm /tmp/example.txt
      
      hello there

        Attachments

          Activity

            People

            • Assignee:
              vpodzime Vratislav Podzimek
              Reporter:
              a10042 Nick Anderson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel