Explorar o código

(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
juniorsysadmin %!s(int64=9) %!d(string=hai) anos
pai
achega
b737557e31
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      manifests/force.pp

+ 4 - 3
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,
   }
 }