Skip to content

Update Release branch with master #1034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Dec 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 60 additions & 16 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-09-04 11:31:12 +0100 using RuboCop version 0.49.1.
# on 2017-12-06 17:18:57 +0000 using RuboCop version 0.51.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -21,16 +21,18 @@ Lint/AmbiguousRegexpLiteral:
- 'spec/unit/puppet/type/mysql_grant_spec.rb'

# Offense count: 1
Lint/DuplicatedKey:
Lint/RescueWithoutErrorClass:
Exclude:
- 'spec/classes/mysql_server_backup_spec.rb'
- 'lib/facter/mysql_server_id.rb'

# Offense count: 1
Lint/HandleExceptions:
# Offense count: 16
Lint/ReturnInVoidContext:
Exclude:
- 'spec/spec_helper.rb'
- 'lib/puppet/provider/mysql_database/mysql.rb'
- 'lib/puppet/provider/mysql_user/mysql.rb'

# Offense count: 1
# Cop supports --auto-correct.
Lint/ScriptPermission:
Exclude:
- 'spec/unit/puppet/functions/mysql_deepmerge_spec.rb'
Expand All @@ -40,17 +42,54 @@ Lint/UselessAssignment:
Exclude:
- 'spec/unit/puppet/functions/mysql_deepmerge_spec.rb'

# Offense count: 11
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 351
# Offense count: 56
# Configuration parameters: Blacklist.
# Blacklist: END, (?-mix:EO[A-Z]{1})
Naming/HeredocDelimiterNaming:
Exclude:
- 'lib/puppet/parser/functions/mysql_deepmerge.rb'
- 'lib/puppet/parser/functions/mysql_dirname.rb'
- 'lib/puppet/parser/functions/mysql_password.rb'
- 'lib/puppet/parser/functions/mysql_strip_hash.rb'
- 'spec/acceptance/locales_spec.rb'
- 'spec/acceptance/mysql_backup_spec.rb'
- 'spec/acceptance/mysql_db_spec.rb'
- 'spec/acceptance/mysql_server_spec.rb'
- 'spec/acceptance/sql_task_spec.rb'
- 'spec/acceptance/types/mysql_database_spec.rb'
- 'spec/acceptance/types/mysql_grant_spec.rb'
- 'spec/acceptance/types/mysql_plugin_spec.rb'
- 'spec/acceptance/types/mysql_user_spec.rb'
- 'spec/classes/mysql_server_account_security_spec.rb'
- 'spec/classes/mysql_server_backup_spec.rb'

# Offense count: 1
RSpec/BeforeAfterAll:
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
Performance/HashEachMethods:
Exclude:
- 'spec/acceptance/**/*.rb'
- 'spec/unit/puppet/functions/mysql_password_spec.rb'
- 'lib/puppet/parser/functions/mysql_strip_hash.rb'
- 'lib/puppet/provider/mysql_database/mysql.rb'
- 'lib/puppet/provider/mysql_grant/mysql.rb'
- 'lib/puppet/provider/mysql_plugin/mysql.rb'
- 'lib/puppet/provider/mysql_user/mysql.rb'
- 'spec/unit/puppet/provider/mysql_user/mysql_spec.rb'

# Offense count: 40
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/acceptance/mysql_backup_spec.rb'
- 'spec/acceptance/types/mysql_user_spec.rb'
- 'spec/classes/graceful_failures_spec.rb'
- 'spec/classes/mycnf_template_spec.rb'
- 'spec/classes/mysql_server_backup_spec.rb'
- 'spec/classes/mysql_server_mysqltuner_spec.rb'
- 'spec/classes/mysql_server_spec.rb'
- 'spec/unit/facter/mysql_server_id_spec.rb'
- 'spec/unit/puppet/type/mysql_grant_spec.rb'
- 'spec/unit/puppet/type/mysql_user_spec.rb'

# Offense count: 56
# Configuration parameters: Max.
Expand Down Expand Up @@ -86,7 +125,7 @@ RSpec/InstanceVariable:
- 'spec/unit/puppet/type/mysql_plugin_spec.rb'
- 'spec/unit/puppet/type/mysql_user_spec.rb'

# Offense count: 38
# Offense count: 42
RSpec/MultipleExpectations:
Max: 4

Expand All @@ -111,6 +150,11 @@ RSpec/ScatteredLet:
- 'spec/unit/puppet/provider/mysql_plugin/mysql_spec.rb'
- 'spec/unit/puppet/provider/mysql_user/mysql_spec.rb'

# Offense count: 1
Style/CommentedKeyword:
Exclude:
- 'spec/spec_helper_acceptance.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
Expand Down
4 changes: 4 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ spec/spec_helper.rb:
extras:
- rvm: 2.1.9
script: bundle exec rake rubocop
.rubocop.yml:
unmanaged: true
.rubocop_todo.yml:
unmanaged: true
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 4 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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'])
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion locales/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": [
{"name":"puppetlabs/translate","version_requirement":">= 1.0.0 < 2.0.0"},
{"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"},
{"name":"puppet/staging","version_requirement":">= 1.0.1 < 3.0.0"}
{"name":"puppet/staging","version_requirement":">= 1.0.1 < 4.0.0"}
],
"operatingsystem_support": [
{
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/sql_task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def expect_multiple_regexes(result:, regexes:)

# Configure all nodes in nodeset
c.before :suite do
run_puppet_access_login(user: 'admin') if pe_install?
run_puppet_access_login(user: 'admin') if pe_install? && puppet_version =~ %r{(5\.\d\.\d)}
hosts.each do |host|
# This will be removed, this is temporary to test localisation.
if (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') && (puppet_version >= '4.10.5' && puppet_version < '5.2.0')
Expand Down
4 changes: 2 additions & 2 deletions tasks/sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down