Skip to content

Commit c63a061

Browse files
authored
Merge pull request #1125 from david22swan/MODULES-7827
(MODULES-7827) - Update i18n test logic for puppet 6
2 parents 87ff7f0 + ba92c1b commit c63a061

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

spec/acceptance/locales_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper_acceptance'
22
require 'beaker/i18n_helper'
33

4-
describe 'mysql localization', if: (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') && puppet_version =~ %r{(^4\.10\.[56789]|5\.\d\.\d)} do
4+
describe 'mysql localization', if: (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') && (Gem::Version.new(puppet_version) >= Gem::Version.new('4.10.5')) do
55
before :all do
66
hosts.each do |host|
77
on(host, "sed -i \"96i FastGettext.locale='ja'\" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb")

spec/spec_helper_acceptance.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828

2929
# Configure all nodes in nodeset
3030
c.before :suite do
31-
run_puppet_access_login(user: 'admin') if pe_install? && puppet_version =~ %r{(5\.\d\.\d)}
31+
run_puppet_access_login(user: 'admin') if pe_install? && (Gem::Version.new(puppet_version) >= Gem::Version.new('5.0.0'))
3232
hosts.each do |host|
3333
# This will be removed, this is temporary to test localisation.
34-
if (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') && (Gem::Version.new(puppet_version) >= Gem::Version.new('4.10.5') &&
34+
if (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') &&
35+
(Gem::Version.new(puppet_version) >= Gem::Version.new('4.10.5') &&
3536
Gem::Version.new(puppet_version) < Gem::Version.new('5.2.0'))
3637
on(host, 'mkdir /opt/puppetlabs/puppet/share/locale/ja')
3738
on(host, 'touch /opt/puppetlabs/puppet/share/locale/ja/puppet.po')

0 commit comments

Comments
 (0)