Skip to content

Commit a2dd06e

Browse files
authored
Merge pull request #1034 from puppetlabs/master
Update Release branch with master
2 parents ded2737 + 79682e7 commit a2dd06e

File tree

11 files changed

+79
-33
lines changed

11 files changed

+79
-33
lines changed

.rubocop_todo.yml

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2017-09-04 11:31:12 +0100 using RuboCop version 0.49.1.
3+
# on 2017-12-06 17:18:57 +0000 using RuboCop version 0.51.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -21,16 +21,18 @@ Lint/AmbiguousRegexpLiteral:
2121
- 'spec/unit/puppet/type/mysql_grant_spec.rb'
2222

2323
# Offense count: 1
24-
Lint/DuplicatedKey:
24+
Lint/RescueWithoutErrorClass:
2525
Exclude:
26-
- 'spec/classes/mysql_server_backup_spec.rb'
26+
- 'lib/facter/mysql_server_id.rb'
2727

28-
# Offense count: 1
29-
Lint/HandleExceptions:
28+
# Offense count: 16
29+
Lint/ReturnInVoidContext:
3030
Exclude:
31-
- 'spec/spec_helper.rb'
31+
- 'lib/puppet/provider/mysql_database/mysql.rb'
32+
- 'lib/puppet/provider/mysql_user/mysql.rb'
3233

3334
# Offense count: 1
35+
# Cop supports --auto-correct.
3436
Lint/ScriptPermission:
3537
Exclude:
3638
- 'spec/unit/puppet/functions/mysql_deepmerge_spec.rb'
@@ -40,17 +42,54 @@ Lint/UselessAssignment:
4042
Exclude:
4143
- 'spec/unit/puppet/functions/mysql_deepmerge_spec.rb'
4244

43-
# Offense count: 11
44-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
45-
# URISchemes: http, https
46-
Metrics/LineLength:
47-
Max: 351
45+
# Offense count: 56
46+
# Configuration parameters: Blacklist.
47+
# Blacklist: END, (?-mix:EO[A-Z]{1})
48+
Naming/HeredocDelimiterNaming:
49+
Exclude:
50+
- 'lib/puppet/parser/functions/mysql_deepmerge.rb'
51+
- 'lib/puppet/parser/functions/mysql_dirname.rb'
52+
- 'lib/puppet/parser/functions/mysql_password.rb'
53+
- 'lib/puppet/parser/functions/mysql_strip_hash.rb'
54+
- 'spec/acceptance/locales_spec.rb'
55+
- 'spec/acceptance/mysql_backup_spec.rb'
56+
- 'spec/acceptance/mysql_db_spec.rb'
57+
- 'spec/acceptance/mysql_server_spec.rb'
58+
- 'spec/acceptance/sql_task_spec.rb'
59+
- 'spec/acceptance/types/mysql_database_spec.rb'
60+
- 'spec/acceptance/types/mysql_grant_spec.rb'
61+
- 'spec/acceptance/types/mysql_plugin_spec.rb'
62+
- 'spec/acceptance/types/mysql_user_spec.rb'
63+
- 'spec/classes/mysql_server_account_security_spec.rb'
64+
- 'spec/classes/mysql_server_backup_spec.rb'
4865

49-
# Offense count: 1
50-
RSpec/BeforeAfterAll:
66+
# Offense count: 6
67+
# Cop supports --auto-correct.
68+
# Configuration parameters: AutoCorrect.
69+
Performance/HashEachMethods:
5170
Exclude:
52-
- 'spec/acceptance/**/*.rb'
53-
- 'spec/unit/puppet/functions/mysql_password_spec.rb'
71+
- 'lib/puppet/parser/functions/mysql_strip_hash.rb'
72+
- 'lib/puppet/provider/mysql_database/mysql.rb'
73+
- 'lib/puppet/provider/mysql_grant/mysql.rb'
74+
- 'lib/puppet/provider/mysql_plugin/mysql.rb'
75+
- 'lib/puppet/provider/mysql_user/mysql.rb'
76+
- 'spec/unit/puppet/provider/mysql_user/mysql_spec.rb'
77+
78+
# Offense count: 40
79+
# Configuration parameters: Prefixes.
80+
# Prefixes: when, with, without
81+
RSpec/ContextWording:
82+
Exclude:
83+
- 'spec/acceptance/mysql_backup_spec.rb'
84+
- 'spec/acceptance/types/mysql_user_spec.rb'
85+
- 'spec/classes/graceful_failures_spec.rb'
86+
- 'spec/classes/mycnf_template_spec.rb'
87+
- 'spec/classes/mysql_server_backup_spec.rb'
88+
- 'spec/classes/mysql_server_mysqltuner_spec.rb'
89+
- 'spec/classes/mysql_server_spec.rb'
90+
- 'spec/unit/facter/mysql_server_id_spec.rb'
91+
- 'spec/unit/puppet/type/mysql_grant_spec.rb'
92+
- 'spec/unit/puppet/type/mysql_user_spec.rb'
5493

5594
# Offense count: 56
5695
# Configuration parameters: Max.
@@ -86,7 +125,7 @@ RSpec/InstanceVariable:
86125
- 'spec/unit/puppet/type/mysql_plugin_spec.rb'
87126
- 'spec/unit/puppet/type/mysql_user_spec.rb'
88127

89-
# Offense count: 38
128+
# Offense count: 42
90129
RSpec/MultipleExpectations:
91130
Max: 4
92131

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

153+
# Offense count: 1
154+
Style/CommentedKeyword:
155+
Exclude:
156+
- 'spec/spec_helper_acceptance.rb'
157+
114158
# Offense count: 7
115159
# Cop supports --auto-correct.
116160
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.

.sync.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ spec/spec_helper.rb:
77
extras:
88
- rvm: 2.1.9
99
script: bundle exec rake rubocop
10+
.rubocop.yml:
11+
unmanaged: true
12+
.rubocop_todo.yml:
13+
unmanaged: true

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ matrix:
2222
script: bundle exec rake beaker
2323
services: docker
2424
sudo: required
25-
- rvm: 2.4.0
25+
- rvm: 2.4.1
2626
bundler_args: --without system_tests
2727
env: PUPPET_GEM_VERSION="~> 5.0"
2828
- rvm: 2.1.9
2929
bundler_args: --without system_tests
3030
env: PUPPET_GEM_VERSION="~> 4.0"
3131
- rvm: 2.1.9
32-
script: bundle exec rubocop lib
32+
script: bundle exec rake rubocop
3333
notifications:
3434
email: false

Gemfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ end
3131
supports_windows = false
3232
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
3333
minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}"
34+
3435
group :development do
3536
gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby"
3637
gem "puppet-module-win-default-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
@@ -44,16 +45,12 @@ end
4445
group :system_tests do
4546
gem "puppet-module-posix-system-r#{minor_version}", :require => false, :platforms => "ruby"
4647
gem "puppet-module-win-system-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
47-
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3')
48+
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3')
4849
gem "beaker-pe", :require => false
49-
gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION'])
50+
gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION'])
5051
gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'])
51-
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
52+
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
5253
gem "puppet-blacksmith", '~> 3.4', :require => false
53-
gem "puppet-lint-i18n"
54-
gem "puppet_pot_generator"
55-
gem "rubocop-i18n", '~> 1.0'
56-
gem "beaker-i18n_helper"
5754
end
5855

5956
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
require 'puppetlabs_spec_helper/rake_tasks'
22
require 'puppet-lint/tasks/puppet-lint'
3-
require 'puppet_pot_generator/rake_tasks' if Bundler.rubygems.find_name('puppet_pot_generator').any?
43
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
54

65
PuppetLint.configuration.fail_on_warnings = true

locales/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ gettext:
2222
# Patterns for +Dir.glob+ used to find all files that might contain
2323
# translatable content, relative to the project root directory
2424
source_files:
25-
- './lib/**/*.rb'
25+
- './lib/**/*.rb'
26+

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"dependencies": [
1111
{"name":"puppetlabs/translate","version_requirement":">= 1.0.0 < 2.0.0"},
1212
{"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"},
13-
{"name":"puppet/staging","version_requirement":">= 1.0.1 < 3.0.0"}
13+
{"name":"puppet/staging","version_requirement":">= 1.0.1 < 4.0.0"}
1414
],
1515
"operatingsystem_support": [
1616
{

spec/acceptance/sql_task_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class { 'mysql::server': root_password => 'password' }
1111
}
1212
EOS
1313

14-
it "sets up a mysql instance" do
14+
it 'sets up a mysql instance' do
1515
apply_manifest(pp, catch_failures: true)
1616
end
1717

spec/spec_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
# put local configuration and setup into spec_helper_local
55
begin
66
require 'spec_helper_local'
7-
rescue LoadError
7+
rescue LoadError => loaderror
8+
puts "Could not require spec_helper_local: #{loaderror.message}"
89
end

spec/spec_helper_acceptance.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def expect_multiple_regexes(result:, regexes:)
6868

6969
# Configure all nodes in nodeset
7070
c.before :suite do
71-
run_puppet_access_login(user: 'admin') if pe_install?
71+
run_puppet_access_login(user: 'admin') if pe_install? && puppet_version =~ %r{(5\.\d\.\d)}
7272
hosts.each do |host|
7373
# This will be removed, this is temporary to test localisation.
7474
if (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') && (puppet_version >= '4.10.5' && puppet_version < '5.2.0')

tasks/sql.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ def get(sql, database, user, password)
88
cmd_string << " --database=#{database}" unless database.nil?
99
cmd_string << " --user=#{user}" unless user.nil?
1010
cmd_string << " --password=#{password}" unless password.nil?
11-
stdout, stderr, status = Open3.capture3(cmd_string)
12-
raise Puppet::Error, _("stderr: '#{stderr}'") if status != 0
11+
stdout, _stderr, status = Open3.capture3(cmd_string)
12+
raise Puppet::Error, _("stderr: ' %{stderr}') % { stderr: stderr }") if status != 0
1313
{ status: stdout.strip }
1414
end
1515

0 commit comments

Comments
 (0)