diff options
Diffstat (limited to 'bin')
-rwxr-xr-x[-rw-r--r--] | bin/node_init | 7 | ||||
-rwxr-xr-x | bin/puppet_command | 10 | ||||
-rwxr-xr-x | bin/run_tests | 8 |
3 files changed, 15 insertions, 10 deletions
diff --git a/bin/node_init b/bin/node_init index da250012..b55cfed3 100644..100755 --- a/bin/node_init +++ b/bin/node_init @@ -22,7 +22,10 @@ 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 + /usr/sbin/locale-gen +fi # # UPDATE PACKAGES @@ -49,6 +52,8 @@ if [[ $error_count > 0 ]]; then exit 1 fi +/usr/bin/apt-get -q -y -o 'DPkg::Options::=--force-confold' dist-upgrade + # # UPDATE TIME # diff --git a/bin/puppet_command b/bin/puppet_command index eb3cd0b9..a2876fd9 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 @@ -173,9 +173,9 @@ def platform_version_check! return unless @info["platform"] new_version = @info["platform"].split(' ').first return unless new_version - if File.exists?(SUMMARY_LOG) && File.size(SUMMARY_LOG) != 0 + if File.exist?(SUMMARY_LOG) && File.size(SUMMARY_LOG) != 0 file = SUMMARY_LOG - elsif File.exists?(SUMMARY_LOG_1) && File.size(SUMMARY_LOG_1) != 0 + elsif File.exist?(SUMMARY_LOG_1) && File.size(SUMMARY_LOG_1) != 0 file = SUMMARY_LOG_1 else return @@ -195,7 +195,7 @@ end # Return a ruby object representing the contents of the hiera yaml file. # def hiera_file - unless File.exists?(HIERA_FILE) + unless File.exist?(HIERA_FILE) log("ERROR: hiera file '#{HIERA_FILE}' does not exist.") exit(1) end diff --git a/bin/run_tests b/bin/run_tests index b6784ed5..8450a9bf 100755 --- a/bin/run_tests +++ b/bin/run_tests @@ -1,7 +1,7 @@ #!/usr/bin/ruby # -# this script will run the unit tests in ../tests/*.rb. +# This script will run the unit tests in /srv/leap/tests # # Tests for the platform differ from traditional ruby unit tests in a few ways: # @@ -29,11 +29,11 @@ EXIT_CODES = { HIERA_FILE = '/etc/leap/hiera.yaml' HELPER_PATHS = [ - '../../tests/helpers/*.rb', + '/srv/leap/tests/server-tests/helpers/*.rb', '/srv/leap/files/tests/helpers/*.rb' ] TEST_PATHS = [ - '../../tests/white-box/*.rb', + '/srv/leap/tests/server-tests/white-box/*.rb', '/srv/leap/files/tests/white-box/*.rb', '/srv/leap/tests_custom/*.rb' ] @@ -459,7 +459,7 @@ end def main # load node data from hiera file - if File.exists?(HIERA_FILE) + if File.exist?(HIERA_FILE) $node = YAML.load_file(HIERA_FILE) else $node = {"services" => [], "dummy" => true} |