Skip to content

Commit c559036

Browse files
Helen CampbellHelen Campbell
Helen Campbell
authored and
Helen Campbell
committed
Merge branch 'i18nTesting' of github.com:puppetlabs/puppetlabs-mysql into i18nTesting
2 parents e236b38 + 44a955e commit c559036

File tree

6 files changed

+15
-22
lines changed

6 files changed

+15
-22
lines changed

lib/puppet/parser/functions/mysql_deepmerge.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module Puppet::Parser::Functions
3939
end
4040
end
4141

42-
def normalized!(hash, key)
42+
def normalized?(hash, key)
4343
return true if hash.key?(key)
4444
return false unless key =~ %r{-|_}
4545
other_key = key.include?('-') ? key.tr('-', '_') : key.tr('_', '-')
@@ -50,7 +50,7 @@ def normalized!(hash, key)
5050

5151
def overlay(hash1, hash2)
5252
hash2.each do |key, value|
53-
if normalized!(hash1, key) && value.is_a?(Hash) && hash1[key].is_a?(Hash)
53+
if normalized?(hash1, key) && value.is_a?(Hash) && hash1[key].is_a?(Hash)
5454
overlay(hash1[key], value)
5555
else
5656
hash1[key] = value

lib/puppet/provider/mysql.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ class Puppet::Provider::Mysql < Puppet::Provider
66
# Make sure we find mysql commands on CentOS and FreeBSD
77
ENV['PATH'] = ENV['PATH'] + ':/usr/libexec:/usr/local/libexec:/usr/local/bin'
88

9-
commands mysql: 'mysql'
10-
commands mysqld: 'mysqld'
11-
commands mysqladmin: 'mysqladmin'
9+
# rubocop:disable Style/HashSyntax
10+
commands :mysql => 'mysql'
11+
commands :mysqld => 'mysqld'
12+
commands :mysqladmin => 'mysqladmin'
13+
# rubocop:enable Style/HashSyntax
1214

1315
# Optional defaults file
1416
def self.defaults_file

lib/puppet/provider/mysql_datadir/mysql.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
commands mysql_install_db: 'mysql_install_db'
1212
# rubocop:disable Lint/UselessAssignment
1313
def create
14-
name = @resource[:name]
14+
name = @resource[:name]
1515
insecure = @resource.value(:insecure) || true
1616
defaults_extra_file = @resource.value(:defaults_extra_file)
1717
user = @resource.value(:user) || 'mysql'
@@ -34,9 +34,7 @@ def create
3434

3535
opts = [defaults_extra_file]
3636
%w[basedir datadir user].each do |opt|
37-
# rubocop:disable Security/Eval
38-
val = eval(opt)
39-
# rubocop:enable Security/Eval
37+
val = eval(opt) # rubocop:disable Security/Eval
4038
opts << "--#{opt}=#{val}" unless val.nil?
4139
end
4240

@@ -57,9 +55,7 @@ def create
5755
end
5856

5957
def destroy
60-
# rubocop:disable Lint/UselessAssignment
61-
name = @resource[:name]
62-
# rubocop:enable Lint/UselessAssignment
58+
name = @resource[:name] # rubocop:disable Lint/UselessAssignment
6359
raise ArgumentError, 'ERROR: Resource can not be removed'
6460
end
6561

lib/puppet/provider/mysql_grant/mysql.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@ def self.instances
6868
def self.prefetch(resources)
6969
users = instances
7070
resources.keys.each do |name|
71-
# rubocop:disable Lint/AssignmentInCondition
72-
if provider = users.find { |user| user.name == name }
71+
if provider = users.find { |user| user.name == name } # rubocop:disable Lint/AssignmentInCondition
7372
resources[name].provider = provider
7473
end
75-
# rubocop:enable Lint/AssignmentInCondition
7674
end
7775
end
7876

lib/puppet/provider/mysql_plugin/mysql.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ def self.instances
1818
def self.prefetch(resources)
1919
plugins = instances
2020
resources.keys.each do |plugin|
21-
# rubocop:disable Lint/AssignmentInCondition
22-
if provider = plugins.find { |pl| pl.name == plugin }
21+
if provider = plugins.find { |pl| pl.name == plugin } # rubocop:disable Lint/AssignmentInCondition
2322
resources[plugin].provider = provider
2423
end
25-
# rubocop:enable Lint/AssignmentInCondition
2624
end
2725
end
2826

spec/classes/graceful_failures_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
describe 'mysql::server' do
44
context "on an unsupported OS" do
55
let(:facts) do
6-
{
7-
:osfamily => 'UNSUPPORTED',
6+
{
7+
:osfamily => 'UNSUPPORTED',
88
:operatingsystem => 'UNSUPPORTED'
99
}
10-
end
11-
10+
end
1211
it 'should gracefully fail' do
1312
is_expected.to compile.and_raise_error(/Unsupported platform:/)
1413
end

0 commit comments

Comments
 (0)