Puppet: System Administration Automated

Support

Ticket #872 (closed defect: fixed)

Opened 1 year ago

Last modified 11 months ago

"replace=>false" file attribute is not handled when using content

Reported by: ctrlaltdel Assigned to: luke
Priority: normal Milestone: misspiggy
Component: language Version: 0.23.2
Severity: normal Keywords: replace file content
Cc: francois@ctrlaltdel.ch Triage Stage: Ready for checkin
Attached Patches: Code Complexity: Easy

Description

The replace attribute of the file type is only handled when using source and not with content.

file-content-replace-1.pp:

file {"/tmp/test1":
        content => "Hello world",
        replace => false,
}

file-content-replace-2.pp:

file {"/tmp/test1":
        content => "bye bye",
        replace => false,
}
$ puppet -v file-content-replace-1.pp 
info: Found dole in none
notice: //File[/tmp/test1]/content: created file with contents {md5}3e25960a79dbc69b674cd4ec67a72c62
$ cat /tmp/test1; echo
Hello world
$ puppet -v file-content-replace-2.pp 
info: Found dole in none
info: //File[/tmp/test1]: Filebucketed to puppet with sum 3e25960a79dbc69b674cd4ec67a72c62
notice: //File[/tmp/test1]/content: changed file contents from {md5}3e25960a79dbc69b674cd4ec67a72c62 to {md5}45c2ca10522952363ec8471e3194077c
$ cat /tmp/test1; echo
bye bye
$

Attachments

file-content-replace.patch (0.6 kB) - added by ctrlaltdel on 10/17/07 19:19:53.
file-replace-false-test.patch (0.9 kB) - added by ctrlaltdel on 11/09/07 19:30:33.

Change History

10/17/07 19:19:53 changed by ctrlaltdel

  • attachment file-content-replace.patch added.

10/17/07 19:21:22 changed by ctrlaltdel

  • patch changed from None to Code.

Attached patch hopefully fix it

10/26/07 20:59:10 changed by luke

  • owner changed from community to luke.
  • status changed from new to assigned.
  • complexity changed from Unknown to Easy.
  • stage changed from Unreviewed to Accepted.
  • milestone set to elmo.

11/09/07 17:47:45 changed by luke

  • milestone changed from elmo to misspiggy.

Test code for this would be great.

11/09/07 19:28:29 changed by DavidS

  • stage changed from Accepted to Ready for checkin.

Applied the patch together with a test to the rest/tests-for-872 branch in my repo at git://git.black.co.at/puppet-bugfixes

11/09/07 19:30:33 changed by ctrlaltdel

  • attachment file-replace-false-test.patch added.

11/14/07 17:49:12 changed by ctrlaltdel

DavidS' version of the test is much better, feel free to discard my last patch.

11/19/07 06:34:04 changed by luke

  • status changed from assigned to closed.
  • resolution set to fixed.