Keep the system locale in the openstack command.

By default puppet reset the locale to "C"[1].  This can cause problem
when openstack command have to deal with non ascii strings.

We use the override_locale parameter of the execute puppet method to
pass down the locale to the openstack command.

Co-Authored-By: Natal Ngétal <hobbestigrou@erakis.eu>
Closes-Bug: #1744075

[1] https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L349-L357

Change-Id: Ia61308d54be4a72faf47b315989b63dc8f64aa09
This commit is contained in:
Sofer Athlan-Guyot 2019-03-05 13:24:22 +01:00
parent fda3700345
commit 8ac560f69f

View File

@ -45,7 +45,7 @@ class Puppet::Provider::Openstack < Puppet::Provider
begin
action = args[1]
Timeout.timeout(command_timeout(action)) do
openstack_command *args
execute([command(:openstack_command)] + args, override_locale: false)
end
rescue Timeout::Error
raise Puppet::ExecutionFailure, "Command: 'openstack #{args.inspect}' has been running for more than #{command_timeout(action)} seconds"