Skip to content

Updated pot file, decorated simple strings #978

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 1 commit into from
Aug 31, 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
2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/mysql_strip_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Puppet::Parser::Functions

hash = args[0]
unless hash.is_a?(Hash)
raise(Puppet::ParseError, 'mysql_strip_hash(): Requires hash to work with')
raise(Puppet::ParseError, _('mysql_strip_hash(): Requires a hash to work.'))
end

# Filter out all the top level blanks.
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/mysql_datadir/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def create

def destroy
name = @resource[:name] # rubocop:disable Lint/UselessAssignment
raise ArgumentError, 'ERROR: Resource can not be removed'
raise ArgumentError, _('ERROR: `Resource` can not be removed.')
end

def exists?
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/mysql_user/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def password_hash=(string)
# default ... if mysqld_version does not work
mysql([defaults_file, system_database, '-e', "SET PASSWORD FOR #{merged_name} = '#{string}'"].compact)
elsif (mysqld_type == 'mysql' || mysqld_type == 'percona') && Puppet::Util::Package.versioncmp(mysqld_version, '5.7.6') >= 0
raise ArgumentError, 'Only mysql_native_password (*ABCD...XXX) hashes are supported' unless string =~ %r{^\*}
raise ArgumentError, _('Only mysql_native_password (*ABCD...XXX) hashes are supported.') unless string =~ %r{^\*}
mysql([defaults_file, system_database, '-e', "ALTER USER #{merged_name} IDENTIFIED WITH mysql_native_password AS '#{string}'"].compact)
else
mysql([defaults_file, system_database, '-e', "SET PASSWORD FOR #{merged_name} = '#{string}'"].compact)
Expand Down
20 changes: 11 additions & 9 deletions lib/puppet/type/mysql_grant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def initialize(*args)
end
# rubocop:enable Style/MultilineBlockChain
validate do
raise('privileges parameter is required.') if self[:ensure] == :present && self[:privileges].nil?
raise('PROXY must be the only privilege specified.') if Array(self[:privileges]).count > 1 && Array(self[:privileges]).include?('PROXY')
raise('table parameter is required.') if self[:ensure] == :present && self[:table].nil?
raise('user parameter is required.') if self[:ensure] == :present && self[:user].nil?
raise(_('`privileges` `parameter` is required.')) if self[:ensure] == :present && self[:privileges].nil?
raise(_('`privileges` `parameter`: PROXY can only be specified by itself.')) if Array(self[:privileges]).count > 1 && Array(self[:privileges]).include?('PROXY')
raise(_('`table` `parameter` is required.')) if self[:ensure] == :present && self[:table].nil?
raise(_('`user` `parameter` is required.')) if self[:ensure] == :present && self[:user].nil?
if self[:user] && self[:table]
raise('name must match user@host/table format') if self[:name] != "#{self[:user]}/#{self[:table]}"
raise(_('`name` `parameter` must match user@host/table format.')) if self[:name] != "#{self[:user]}/#{self[:table]}"
end
end

Expand All @@ -63,7 +63,9 @@ def initialize(*args)
desc 'Table to apply privileges to.'

validate do |value|
raise(ArgumentError, '"table" for PROXY should be specified as proxy_user@proxy_host') if Array(@resource[:privileges]).include?('PROXY') && !%r{^[0-9a-zA-Z$_]*@[\w%\.:\-\/]*$}.match(value)
if Array(@resource[:privileges]).include?('PROXY') && !%r{^[0-9a-zA-Z$_]*@[\w%\.:\-\/]*$}.match(value)
raise(ArgumentError, _('`table` `property` for PROXY should be specified as proxy_user@proxy_host .'))
end
end

munge do |value|
Expand Down Expand Up @@ -97,9 +99,9 @@ def initialize(*args)
# rubocop:enable Lint/UselessAssignment
mysql_version = Facter.value(:mysql_version)
unless mysql_version.nil?
raise(ArgumentError, 'MySQL usernames are limited to a maximum of 16 characters') if Puppet::Util::Package.versioncmp(mysql_version, '5.7.8') < 0 && user_part.size > 16
raise(ArgumentError, 'MySQL usernames are limited to a maximum of 32 characters') if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') < 0 && user_part.size > 32
raise(ArgumentError, 'MySQL usernames are limited to a maximum of 80 characters') if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') > 0 && user_part.size > 80
raise(ArgumentError, _('MySQL usernames are limited to a maximum of 16 characters.')) if Puppet::Util::Package.versioncmp(mysql_version, '5.7.8') < 0 && user_part.size > 16
raise(ArgumentError, _('MySQL usernames are limited to a maximum of 32 characters.')) if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') < 0 && user_part.size > 32
raise(ArgumentError, _('MySQL usernames are limited to a maximum of 80 characters.')) if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') > 0 && user_part.size > 80
end
end

Expand Down
8 changes: 4 additions & 4 deletions lib/puppet/type/mysql_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
# rubocop:enable Lint/AssignmentInCondition
# rubocop:enable Lint/UselessAssignment
unless mysql_version.nil?
raise(ArgumentError, 'MySQL usernames are limited to a maximum of 16 characters') if Puppet::Util::Package.versioncmp(mysql_version, '5.7.8') < 0 && user_part.size > 16
raise(ArgumentError, 'MySQL usernames are limited to a maximum of 32 characters') if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') < 0 && user_part.size > 32
raise(ArgumentError, 'MySQL usernames are limited to a maximum of 80 characters') if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') > 0 && user_part.size > 80
raise(ArgumentError, _('MySQL usernames are limited to a maximum of 16 characters.')) if Puppet::Util::Package.versioncmp(mysql_version, '5.7.8') < 0 && user_part.size > 16
raise(ArgumentError, _('MySQL usernames are limited to a maximum of 32 characters.')) if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') < 0 && user_part.size > 32
raise(ArgumentError, _('MySQL usernames are limited to a maximum of 80 characters.')) if Puppet::Util::Package.versioncmp(mysql_version, '10.0.0') > 0 && user_part.size > 80
end
end

Expand Down Expand Up @@ -79,7 +79,7 @@
value = [value] unless value.is_a?(Array)
if value.include?('NONE') || value.include?('SSL') || value.include?('X509')
if value.length > 1
raise(ArgumentError, 'REQUIRE tls options NONE, SSL and X509 cannot be used with other options, you may only use one of them.')
raise(ArgumentError, _('`tls_options` `property`: The values NONE, SSL and X509 cannot be used with other options, you may only pick one of them.'))
end
else
value.each do |opt|
Expand Down
58 changes: 31 additions & 27 deletions locales/puppetlabs-mysql.pot
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ msgstr ""
"X-Generator: Translate Toolkit 2.0.0\n"

#. ./manifests/server.pp:48
msgid "old_root_password is no longer used and will be removed in a future release"
msgid ""
"The `old_root_password` attribute is no longer used and will be removed in a f"
"uture release."
msgstr ""

#. metadata.json
Expand All @@ -27,54 +29,56 @@ msgstr ""
msgid "MySQL module"
msgstr ""

#: ../lib/puppet/parser/functions/mysql_strip_hash.rb:11
msgid "mysql_strip_hash(): Requires hash to work with"
#: ./lib/puppet/parser/functions/mysql_strip_hash.rb:11
msgid "mysql_strip_hash(): Requires a hash to work."
msgstr ""

#: ../lib/puppet/provider/mysql_datadir/mysql.rb:59
msgid "ERROR: Resource can not be removed"
#: ./lib/puppet/provider/mysql_datadir/mysql.rb:59
msgid "ERROR: `Resource` can not be removed."
msgstr ""

#: ../lib/puppet/provider/mysql_user/mysql.rb:125
msgid "Only mysql_native_password (*ABCD...XXX) hashes are supported"
#: ./lib/puppet/provider/mysql_user/mysql.rb:125
msgid "Only mysql_native_password (*ABCD...XXX) hashes are supported."
msgstr ""

#: ../lib/puppet/type/mysql_grant.rb:34
msgid "privileges parameter is required."
#: ./lib/puppet/type/mysql_grant.rb:34
msgid "`privileges` `parameter` is required."
msgstr ""

#: ../lib/puppet/type/mysql_grant.rb:35
msgid "PROXY must be the only privilege specified."
#: ./lib/puppet/type/mysql_grant.rb:35
msgid "`privileges` `parameter`: PROXY can only be specified by itself."
msgstr ""

#: ../lib/puppet/type/mysql_grant.rb:36
msgid "table parameter is required."
#: ./lib/puppet/type/mysql_grant.rb:36
msgid "`table` `parameter` is required."
msgstr ""

#: ../lib/puppet/type/mysql_grant.rb:37
msgid "user parameter is required."
#: ./lib/puppet/type/mysql_grant.rb:37
msgid "`user` `parameter` is required."
msgstr ""

#: ../lib/puppet/type/mysql_grant.rb:39
msgid "name must match user@host/table format"
#: ./lib/puppet/type/mysql_grant.rb:39
msgid "`name` `parameter` must match user@host/table format."
msgstr ""

#: ../lib/puppet/type/mysql_grant.rb:66
msgid "\"table\" for PROXY should be specified as proxy_user@proxy_host"
#: ./lib/puppet/type/mysql_grant.rb:67
msgid "`table` `property` for PROXY should be specified as proxy_user@proxy_host ."
msgstr ""

#: ../lib/puppet/type/mysql_grant.rb:100 ../lib/puppet/type/mysql_user.rb:34
msgid "MySQL usernames are limited to a maximum of 16 characters"
#: ./lib/puppet/type/mysql_grant.rb:102 ./lib/puppet/type/mysql_user.rb:34
msgid "MySQL usernames are limited to a maximum of 16 characters."
msgstr ""

#: ../lib/puppet/type/mysql_grant.rb:101 ../lib/puppet/type/mysql_user.rb:35
msgid "MySQL usernames are limited to a maximum of 32 characters"
#: ./lib/puppet/type/mysql_grant.rb:103 ./lib/puppet/type/mysql_user.rb:35
msgid "MySQL usernames are limited to a maximum of 32 characters."
msgstr ""

#: ../lib/puppet/type/mysql_grant.rb:102 ../lib/puppet/type/mysql_user.rb:36
msgid "MySQL usernames are limited to a maximum of 80 characters"
#: ./lib/puppet/type/mysql_grant.rb:104 ./lib/puppet/type/mysql_user.rb:36
msgid "MySQL usernames are limited to a maximum of 80 characters."
msgstr ""

#: ../lib/puppet/type/mysql_user.rb:82
msgid "REQUIRE tls options NONE, SSL and X509 cannot be used with other options, you may only use one of them."
#: ./lib/puppet/type/mysql_user.rb:82
msgid ""
"`tls_options` `property`: The values NONE, SSL and X509 cannot be used with ot"
"her options, you may only pick one of them."
msgstr ""
2 changes: 1 addition & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
$real_service_manage = $service_manage
}
if $old_root_password {
warning('old_root_password is no longer used and will be removed in a future release')
warning(translate('The `old_root_password` attribute is no longer used and will be removed in a future release.'))
}

# Create a merged together set of options. Rightmost hashes win over left.
Expand Down
8 changes: 4 additions & 4 deletions spec/acceptance/types/mysql_grant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class { 'mysql::server':
}
EOS

expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/privileges parameter is required/)
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/`privileges` `parameter` is required/)
end

it 'should not find the user' do
Expand Down Expand Up @@ -151,7 +151,7 @@ class { 'mysql::server':
}
EOS

expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/table parameter is required./)
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/`table` `parameter` is required./)
end
end

Expand Down Expand Up @@ -492,7 +492,7 @@ class { 'mysql::server':
}
EOS

expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/PROXY must be the only privilege specified/)
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/`privileges` `parameter`: PROXY can only be specified by itself/)
end

it 'should not find the user' do
Expand Down Expand Up @@ -538,7 +538,7 @@ class { 'mysql::server':
}
EOS

expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/"table" for PROXY should be specified as proxy_user@proxy_host/)
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/`table` `property` for PROXY should be specified as proxy_user@proxy_host ./)
end

it 'should not find the user' do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/type/mysql_grant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
}.to_not raise_error
expect {
Puppet::Type.type(:mysql_grant).new(:name => 'foo', :privileges => ['ALL'], :table => ['*.*'], :user => 'foo@localhost')
}.to raise_error /name must match user@host\/table format/
}.to raise_error /`name` `parameter` must match user@host\/table format/
end

describe 'it should munge privileges' do
Expand Down