You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Puppet 8.7.0, issuing this line: $ puppet apply -e "file { '/tmp/test': ensure => 'file', content => \"# anything\n{abc}$\n# anything\" }"
results in a deprecation warning and error:
$ puppet apply -e "file { '/tmp/test': ensure => 'file', content => \"# anything\n{abc}$\n# anything\" }"
Notice: Compiled catalog for my_machine in environment production in 0.01 seconds
Warning: Using a checksum in a file's "content" property is deprecated. The ability to use a checksum to retrieve content from the filebucket using the "content" property will be removed in a future release. The literal value of the "content" property will be written to the file. The checksum retrieval functionality is being replaced by the use of static catalogs. See https://puppet.com/docs/puppet/latest/static_catalogs.html for more information.
(file: unknown, line: 1)
Error: Could not retrieve content for # anything
{abc}$
# anything from filebucket: Could not get filebucket from file
Error: /Stage[main]/Main/File[/tmp/test]/ensure: change from 'absent' to 'file' failed: Could not retrieve content for # anything
{abc}$
# anything from filebucket: Could not get filebucket from file
Notice: Applied catalog in 0.01 seconds
Expected Behavior
File /tmp/test is created without error with content:
This block triggers the deprecation warning and maybe the error too:
elsif value.is_a?(String) && checksum?(value)
# XXX This is potentially dangerous because it means users can't write a file whose
# entire contents are a plain checksum unless it is a Binary content.
Puppet.puppet_deprecation_warning([
...
Hi @tmu-sprd , thank you for reporting this issue! While we agree this is likely a bug, we do not anticipate addressing this any time soon due to other issues demanding precedence. However, this is on the team's radar.
Describe the Bug
Using Puppet 8.7.0, issuing this line:
$ puppet apply -e "file { '/tmp/test': ensure => 'file', content => \"# anything\n{abc}$\n# anything\" }"
results in a deprecation warning and error:
Expected Behavior
File
/tmp/test
is created without error with content:Steps to Reproduce
Steps to reproduce the behavior:
puppet apply -e "file { '/tmp/test': ensure => 'file', content => \"# anything\n{abc}$\n# anything\" }"
Environment
Additional Context
https://github.com/puppetlabs/puppet/blob/main/lib/puppet/type/file/content.rb#L50
https://github.com/puppetlabs/puppet/blob/main/lib/puppet/util/checksums.rb#L41
The text was updated successfully, but these errors were encountered: