diff options
author | elijah <elijah@riseup.net> | 2016-08-23 13:34:07 -0700 |
---|---|---|
committer | Micah <micah@leap.se> | 2016-08-25 15:54:34 -0400 |
commit | 00f62b8a0e118dee569ad8f90e93009a4ded1487 (patch) | |
tree | 39a0f637b4f21532b5f7235f1363773c64927a9a /bin | |
parent | a0113e33c9dfbb52c1865aa0001236822aa21a13 (diff) |
locale improvements: allow non-english locales in node_init, enforce UTF8 locale for `puppet apply`.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/node_init | 4 | ||||
-rwxr-xr-x | bin/puppet_command | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/bin/node_init b/bin/node_init index da250012..ea4c29c5 100644 --- a/bin/node_init +++ b/bin/node_init @@ -22,7 +22,9 @@ if ! egrep -q "$DEBIAN_VERSION" /etc/debian_version; then exit 1 fi mkdir -p $LEAP_DIR -echo "en_US.UTF-8 UTF-8" > /etc/locale.gen +if ! grep -q -e '^en_US.UTF-8' /etc/locale.gen; then + echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen +fi # # UPDATE PACKAGES diff --git a/bin/puppet_command b/bin/puppet_command index eb3cd0b9..dee3f5ce 100755 --- a/bin/puppet_command +++ b/bin/puppet_command @@ -28,7 +28,7 @@ SUMMARY_LOG = '/var/log/leap/deploy-summary.log' SUMMARY_LOG_1 = '/var/log/leap/deploy-summary.log.1' APPLY_START_STR = "STARTING APPLY" APPLY_FINISH_STR = "APPLY COMPLETE" - +LANG = "en_US.UTF-8" def main if File.read('/etc/debian_version') !~ DEBIAN_VERSION @@ -144,7 +144,7 @@ def puppet_apply(options={}, &block) fqdn = hiera_file['domain']['full'] domain = hiera_file['domain']['full_suffix'] Dir.chdir(PUPPET_DIRECTORY) do - return run("FACTER_fqdn='#{fqdn}' FACTER_domain='#{domain}' #{PUPPET_BIN} apply #{custom_parameters(options)} --modulepath='#{modulepath}' #{PUPPET_PARAMETERS} #{manifest}", &block) + return run("LANG='#{LANG}' FACTER_fqdn='#{fqdn}' FACTER_domain='#{domain}' #{PUPPET_BIN} apply #{custom_parameters(options)} --modulepath='#{modulepath}' #{PUPPET_PARAMETERS} #{manifest}", &block) end end |