Skip to content

Commit 670cbd6

Browse files
committed
Addressing puppet-lint and rubocop errors
1 parent 4a35815 commit 670cbd6

File tree

12 files changed

+25
-22
lines changed

12 files changed

+25
-22
lines changed

manifests/bindings.pp

+9-3
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@
3535

3636
case $::osfamily {
3737
'Archlinux': {
38-
if $java_enable { fail(translate('::mysql::bindings::java cannot be managed by puppet on %{osfamily} as it is not in official repositories. Please disable java mysql binding.', {'osfamily' => $::osfamily })) }
38+
if $java_enable { fail(translate('::mysql::bindings::java cannot be managed by puppet on %{osfamily}
39+
as it is not in official repositories. Please disable java mysql binding.',
40+
{'osfamily' => $::osfamily })) }
3941
if $perl_enable { include '::mysql::bindings::perl' }
40-
if $php_enable { warning(translate('::mysql::bindings::php does not need to be managed by puppet on %{osfamily} as it is included in mysql package by default.', {'osfamily' => $::osfamily })) }
42+
if $php_enable { warning(translate('::mysql::bindings::php does not need to be managed by puppet on %{osfamily}
43+
as it is included in mysql package by default.',
44+
{'osfamily' => $::osfamily })) }
4145
if $python_enable { include '::mysql::bindings::python' }
42-
if $ruby_enable { fail(translate('::mysql::bindings::ruby cannot be managed by puppet on %{osfamily} as it is not in official repositories. Please disable ruby mysql binding.', {'osfamily' => $::osfamily } )) }
46+
if $ruby_enable { fail(translate('::mysql::bindings::ruby cannot be managed by puppet on %{osfamily}
47+
as it is not in official repositories. Please disable ruby mysql binding.',
48+
{'osfamily' => $::osfamily } )) }
4349
}
4450

4551
default: {

manifests/params.pp

+4-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@
121121
}
122122
}
123123
default: {
124-
fail(translate('Unsupported platform: puppetlabs-%{module_name} currently doesn\'t support %{os}.', {'module_name' => $module_name, 'os' => $::operatingsystem }))
124+
fail(translate('Unsupported platform: puppetlabs-%{module_name} currently doesn\'t support %{os}.',
125+
{'module_name' => $module_name, 'os' => $::operatingsystem }))
125126
}
126127
}
127128
$config_file = '/etc/my.cnf'
@@ -380,7 +381,8 @@
380381
}
381382

382383
default: {
383-
fail(translate('Unsupported platform: puppetlabs-%{module_name} currently doesn\'t support %{osfamily} or %{os}.', {'module_name' => $module_name, 'os' => $::operatingsystem, 'osfamily' => $::osfamily}))
384+
fail(translate('Unsupported platform: puppetlabs-%{module_name} currently doesn\'t support %{osfamily} or %{os}.',
385+
{'module_name' => $module_name, 'os' => $::operatingsystem, 'osfamily' => $::osfamily}))
384386
}
385387
}
386388
}

manifests/server/backup.pp

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
) {
2626

2727
if $prescript and $provider =~ /(mysqldump|mysqlbackup)/ {
28-
warning(translate("The 'prescript' option is not currently implemented for the %{provider} backup provider.", {'provider' => $provider}))
28+
warning(translate("The 'prescript' option is not currently implemented for the %{provider} backup provider.",
29+
{'provider' => $provider}))
2930
}
3031

3132
create_resources('class', {

manifests/server/config.pp

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
# on mariadb systems, $includedir is not defined, but /etc/my.cnf.d has
4141
# to be managed to place the server.cnf there
4242
$configparentdir = mysql_dirname($mysql::server::config_file)
43-
if $configparentdir != '/' and $configparentdir != '/etc' and $configparentdir != $includedir and $configparentdir != mysql_dirname($includedir) {
43+
if $configparentdir != '/' and $configparentdir != '/etc' and $configparentdir
44+
!= $includedir and $configparentdir != mysql_dirname($includedir) {
4445
file { $configparentdir:
4546
ensure => directory,
4647
mode => '0755',
@@ -50,7 +51,8 @@
5051

5152
if $options['mysqld']['ssl-disable'] {
5253
notify {'ssl-disable':
53-
message =>'Disabling SSL is evil! You should never ever do this except if you are forced to use a mysql version compiled without SSL support'
54+
message =>'Disabling SSL is evil! You should never ever do this except
55+
if you are forced to use a mysql version compiled without SSL support'
5456
}
5557
}
5658
}

manifests/server/service.pp

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
$service_ensure = undef
1313
}
1414

15-
if $mysql::server::override_options and $mysql::server::override_options['mysqld'] and $mysql::server::override_options['mysqld']['user'] {
15+
if $mysql::server::override_options and $mysql::server::override_options['mysqld']
16+
and $mysql::server::override_options['mysqld']['user'] {
1617
$mysqluser = $mysql::server::override_options['mysqld']['user']
1718
} else {
1819
$mysqluser = $options['mysqld']['user']
@@ -40,7 +41,8 @@
4041
File['mysql-config-file'] -> Service['mysqld']
4142
}
4243

43-
if $mysql::server::override_options and $mysql::server::override_options['mysqld'] and $mysql::server::override_options['mysqld']['socket'] {
44+
if $mysql::server::override_options and $mysql::server::override_options['mysqld']
45+
and $mysql::server::override_options['mysqld']['socket'] {
4446
$mysqlsocket = $mysql::server::override_options['mysqld']['socket']
4547
} else {
4648
$mysqlsocket = $options['mysqld']['socket']

spec/acceptance/mysql_backup_spec.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class { 'mysql::server::backup':
3535
end
3636

3737
describe 'mysqlbackup.sh' do
38-
# rubocop:disable RSpec/MultipleExpectations, RSpec/ExampleLength
3938
before(:all) do
4039
pre_run
4140
end
@@ -111,7 +110,6 @@ class { 'mysql::server::backup':
111110
end
112111

113112
describe 'mysqlbackup.sh' do
114-
# rubocop:disable RSpec/MultipleExpectations, RSpec/ExampleLength
115113
before(:all) do
116114
pre_run
117115
end
@@ -192,7 +190,7 @@ class { 'mysql::server::backup':
192190
apply_manifest(pp, catch_failures: true)
193191
end
194192

195-
it 'runs mysqlbackup.sh with no errors' do # rubocop:disable RSpec/ExampleLength
193+
it 'runs mysqlbackup.sh with no errors' do
196194
pre_run
197195
unless version_is_greater_than('5.7.0')
198196
shell('/usr/local/sbin/mysqlbackup.sh') do |r|

spec/acceptance/types/mysql_grant_spec.rb

-3
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ class { 'mysql::server':
455455
end
456456

457457
describe 'adding function privileges' do
458-
# rubocop:disable RSpec/ExampleLength
459458
it 'works without errors' do
460459
pp = <<-EOS
461460
exec { 'simplefunc-create':
@@ -479,8 +478,6 @@ class { 'mysql::server':
479478
apply_manifest(pp, catch_failures: true)
480479
end
481480
# rubocop:enable RSpec/ExampleLength
482-
483-
# rubocop:disable RSpec/MultipleExpectations
484481
it 'finds the user' do
485482
shell('mysql -NBe "SHOW GRANTS FOR test3@tester"') do |r|
486483
expect(r.stdout).to match(%r{GRANT EXECUTE ON FUNCTION `mysql`.`simplefunc` TO 'test3'@'tester'})

spec/acceptance/types/mysql_user_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class { 'mysql::server': }
4646
end
4747

4848
pre_run
49-
50-
# rubocop:disable RSpec/ExampleLength, RSpec/MultipleExpectations
5149
describe 'changing authentication plugin', if: version_is_greater_than('5.5.0') do
5250
it 'works without errors' do
5351
pp = <<-EOS

spec/classes/mysql_server_backup_spec.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require 'spec_helper'
22

33
describe 'mysql::server::backup' do
4-
# rubocop:disable RSpec/NestedGroups
54
on_supported_os.each do |os, facts|
65
context "on #{os}" do
76
let(:pre_condition) do

spec/classes/mysql_server_spec.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require 'spec_helper'
22

33
describe 'mysql::server' do
4-
# rubocop:disable RSpec/NestedGroups
54
on_supported_os.each do |os, facts|
65
context "on #{os}" do
76
let(:facts) do

spec/unit/puppet/provider/mysql_database/mysql_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
end
3434

3535
describe 'self.instances' do
36-
it 'returns an array of databases' do # rubocop:disable RSpec/ExampleLength
36+
it 'returns an array of databases' do
3737
provider.class.stubs(:mysql_caller).with('show databases', 'regular').returns(raw_databases)
3838
raw_databases.each_line do |db|
3939
provider.class.stubs(:mysql_caller).with(["show variables like '%_database'", db.chomp], 'regular').returns("character_set_database latin1\ncollation_database latin1_swedish_ci\nskip_show_database OFF") # rubocop:disable Metrics/LineLength

spec/unit/puppet/provider/mysql_user/mysql_spec.rb

-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@
278278
end
279279

280280
describe 'plugin=' do
281-
# rubocop:disable RSpec/NestedGroups
282281
context 'auth_socket' do
283282
context 'MySQL < 5.7.6' do
284283
it 'changes the authentication plugin' do

0 commit comments

Comments
 (0)