Skip to content

Commit 3563382

Browse files
committed
(PUP-9648) Use binary_file instead of file
The `file` function returns a `String`, not `Binary`, so if the string contains data that is not valid UTF-8, then puppetserver will fail to serialize the catalog as `rich_data_json`. However as described in PUP-10928, puppet will fallback to either `rich_data_msgpack` (if msgpack is installed as a puppetserver gem) or fallback to `pson`. Rich data support was added to agents in Puppet 6, so just use the `binary_file` function instead of relying on the fallback behavior.
1 parent 10f5385 commit 3563382

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

acceptance/tests/catalog_with_binary_data.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class #{test_num}(
4545
\$test_path = \$facts['networking']['fqdn'] ? #{agent_tmp_dirs}
4646
file { '#{test_num}':
4747
path => "\$test_path/#{test_num}",
48-
content => file('#{test_num}/binary_data'),
48+
content => binary_file('#{test_num}/binary_data'),
4949
ensure => present,
5050
}
5151
}

0 commit comments

Comments
 (0)