]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
(MODULES-1231) Fix apt::force locale issues
authorjuniorsysadmin <juniorsysadmin@users.noreply.github.com>
Thu, 11 Dec 2014 02:41:01 +0000 (13:41 +1100)
committerjuniorsysadmin <juniorsysadmin@users.noreply.github.com>
Mon, 15 Dec 2014 12:31:09 +0000 (23:31 +1100)
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

manifests/force.pp

index 7524981da251452ec6e125c51afce9b55ef204e2..8ceeb17060a57cf68d50a6681542cde134ecd7ce 100644 (file)
@@ -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,
   }
 }