From: juniorsysadmin Date: Thu, 11 Dec 2014 02:41:01 +0000 (+1100) Subject: (MODULES-1231) Fix apt::force locale issues X-Git-Tag: 1.8.0~29^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b737557e314f23d0cb5098f60b35525241372dd9;p=puppet-modules%2Fpuppetlabs-apt.git (MODULES-1231) Fix apt::force locale issues The current $install_check variable greps for 'Installed' or 'Candidate', which means that it will give the wrong result when a non-English locale is used. This patch ensures that the check will work properly for non-English locales by setting the environment parameters for the exec to LC_ALL=C LANG=C --- diff --git a/manifests/force.pp b/manifests/force.pp index 7524981..8ceeb17 100644 --- a/manifests/force.pp +++ b/manifests/force.pp @@ -52,8 +52,9 @@ define apt::force( } exec { "${provider} -y ${config_files} ${config_missing} ${release_string} install ${name}${version_string}": - unless => $install_check, - logoutput => 'on_failure', - timeout => $timeout, + unless => $install_check, + environment => ['LC_ALL=C', 'LANG=C'], + logoutput => 'on_failure', + timeout => $timeout, } }