From f4c4665d07da9da3644ce7ce998e97f82ece7510 Mon Sep 17 00:00:00 2001 From: Paula McMaw Date: Fri, 17 Nov 2017 12:17:23 +0000 Subject: [PATCH 1/2] Module sync 1d81b6a --- .travis.yml | 4 ++-- Gemfile | 11 ++++------- Rakefile | 1 - locales/config.yaml | 3 ++- spec/spec_helper.rb | 3 ++- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 09eacc6d0..6055eb19c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,13 +22,13 @@ matrix: script: bundle exec rake beaker services: docker sudo: required - - rvm: 2.4.0 + - rvm: 2.4.1 bundler_args: --without system_tests env: PUPPET_GEM_VERSION="~> 5.0" - rvm: 2.1.9 bundler_args: --without system_tests env: PUPPET_GEM_VERSION="~> 4.0" - rvm: 2.1.9 - script: bundle exec rubocop lib + script: bundle exec rake rubocop notifications: email: false diff --git a/Gemfile b/Gemfile index 0618bfa91..a9f0161c7 100644 --- a/Gemfile +++ b/Gemfile @@ -31,6 +31,7 @@ end supports_windows = false ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}" + group :development do gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby" gem "puppet-module-win-default-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"] @@ -44,16 +45,12 @@ end group :system_tests do gem "puppet-module-posix-system-r#{minor_version}", :require => false, :platforms => "ruby" gem "puppet-module-win-system-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"] - gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3') + gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3') gem "beaker-pe", :require => false - gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION']) + gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION']) gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION']) - gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1') + gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1') gem "puppet-blacksmith", '~> 3.4', :require => false - gem "puppet-lint-i18n" - gem "puppet_pot_generator" - gem "rubocop-i18n", '~> 1.0' - gem "beaker-i18n_helper" end gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION']) diff --git a/Rakefile b/Rakefile index 0c0772c76..d12d85495 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,5 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' -require 'puppet_pot_generator/rake_tasks' if Bundler.rubygems.find_name('puppet_pot_generator').any? require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? PuppetLint.configuration.fail_on_warnings = true diff --git a/locales/config.yaml b/locales/config.yaml index 20c34af2f..e3f7805bb 100644 --- a/locales/config.yaml +++ b/locales/config.yaml @@ -22,4 +22,5 @@ gettext: # Patterns for +Dir.glob+ used to find all files that might contain # translatable content, relative to the project root directory source_files: - - './lib/**/*.rb' + - './lib/**/*.rb' + diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1b8480d41..01912b60c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,5 +4,6 @@ # put local configuration and setup into spec_helper_local begin require 'spec_helper_local' -rescue LoadError +rescue LoadError => loaderror + puts "Could not require spec_helper_local: #{loaderror.message}" end From e5b7a459fc442af396938bdfff1427d77e59cae1 Mon Sep 17 00:00:00 2001 From: Paula McMaw Date: Tue, 21 Nov 2017 08:55:00 +0000 Subject: [PATCH 2/2] Addressing Rubocop Errors --- spec/acceptance/sql_task_spec.rb | 2 +- tasks/sql.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/acceptance/sql_task_spec.rb b/spec/acceptance/sql_task_spec.rb index fcf8ac02e..cc29d2927 100644 --- a/spec/acceptance/sql_task_spec.rb +++ b/spec/acceptance/sql_task_spec.rb @@ -11,7 +11,7 @@ class { 'mysql::server': root_password => 'password' } } EOS - it "sets up a mysql instance" do + it 'sets up a mysql instance' do apply_manifest(pp, catch_failures: true) end diff --git a/tasks/sql.rb b/tasks/sql.rb index c7ddb917a..0d0ee8612 100755 --- a/tasks/sql.rb +++ b/tasks/sql.rb @@ -8,8 +8,8 @@ def get(sql, database, user, password) cmd_string << " --database=#{database}" unless database.nil? cmd_string << " --user=#{user}" unless user.nil? cmd_string << " --password=#{password}" unless password.nil? - stdout, stderr, status = Open3.capture3(cmd_string) - raise Puppet::Error, _("stderr: '#{stderr}'") if status != 0 + stdout, _stderr, status = Open3.capture3(cmd_string) + raise Puppet::Error, _("stderr: ' %{stderr}') % { stderr: stderr }") if status != 0 { status: stdout.strip } end