Skip to content

Commit

Permalink
(IAC1420) - Fix for invalid byte sequence
Browse files Browse the repository at this point in the history
Forcibly set the locale of the command to prevent any invalid byte sequences from being returned.
  • Loading branch information
David Swan committed Mar 10, 2021
1 parent 0c4fb04 commit 769a65b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/puppet_litmus/puppet_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ def apply_manifest(manifest, opts = {})
span.add_field('litmus.node_name', target_node_name)
add_platform_field(inventory_hash, target_node_name)

command_to_run = "#{opts[:prefix_command]} puppet apply #{manifest_file_location}"
# Forcibly set the locale of the command
locale = if os[:family] != 'windows'
'LC_ALL=en_US.UTF-8 '
else
''
end
command_to_run = "#{locale}#{opts[:prefix_command]} puppet apply #{manifest_file_location}"
command_to_run += ' --trace' if !opts[:trace].nil? && (opts[:trace] == true)
command_to_run += " --modulepath #{Dir.pwd}/spec/fixtures/modules" if target_node_name == 'litmus_localhost'
command_to_run += " --hiera_config='#{opts[:hiera_config]}'" unless opts[:hiera_config].nil?
Expand Down

0 comments on commit 769a65b

Please sign in to comment.