From 8ac560f69f815d68e99fb01da0446593024fc0b7 Mon Sep 17 00:00:00 2001 From: Sofer Athlan-Guyot Date: Tue, 5 Mar 2019 13:24:22 +0100 Subject: [PATCH] Keep the system locale in the openstack command. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Closes-Bug: #1744075 [1] https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L349-L357 Change-Id: Ia61308d54be4a72faf47b315989b63dc8f64aa09 --- lib/puppet/provider/openstack.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/openstack.rb b/lib/puppet/provider/openstack.rb index 0240ce4b..7397b0d1 100644 --- a/lib/puppet/provider/openstack.rb +++ b/lib/puppet/provider/openstack.rb @@ -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"