Skip to content

Commit 8d5e3ea

Browse files
committed
Small improvements
1 parent f47c356 commit 8d5e3ea

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

lib/puppet/provider/mysql_grant/mysql.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ def self.instances
6868
'UPDATE']
6969
sorted_privileges = ['ALL']
7070

71-
# Currently there is an issue with the behaviour of the module which was highlighted by the 'complex test' test case in 'mysql_grant_spec'. The module, upon retrieving all privileges from an
72-
# user, does not take into account that the latest version of mysql now includes dynamic privileges which are returned alongside the original static privileges and are set by 'ALL PRIVILEGES'
73-
# (shortened to 'ALL'). This is a workaround to remove the unnecesary privileges from the sorted_privileges list which is used to check for idempotency in test cases.
71+
# The following two elsif blocks of code are a workaround for issue #1474.
7472
elsif sorted_privileges == ['ALL', 'APPLICATION_PASSWORD_ADMIN', 'AUDIT_ABORT_EXEMPT', 'AUDIT_ADMIN', 'AUTHENTICATION_POLICY_ADMIN', 'BACKUP_ADMIN', 'BINLOG_ADMIN', 'BINLOG_ENCRYPTION_ADMIN',
7573
'CLONE_ADMIN', 'CONNECTION_ADMIN', 'ENCRYPTION_KEY_ADMIN', 'FLUSH_OPTIMIZER_COSTS', 'FLUSH_STATUS', 'FLUSH_TABLES', 'FLUSH_USER_RESOURCES',
7674
'GROUP_REPLICATION_ADMIN', 'GROUP_REPLICATION_STREAM', 'INNODB_REDO_LOG_ARCHIVE', 'INNODB_REDO_LOG_ENABLE', 'PASSWORDLESS_USER_ADMIN', 'PERSIST_RO_VARIABLES_ADMIN',

spec/acceptance/04_mysql_backup_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class { 'mysql::server::backup':
205205
end
206206
end
207207

208-
describe 'xtrabackup.sh', if: Gem::Version.new(mysql_version) < Gem::Version.new('5.7.0') && ((os[:family] == 'debian' && os[:release].to_i >= 9) || (os[:family] == 'ubuntu' && os[:release] =~ %r{^16\.04|^18\.04}) || (os[:family] == 'redhat' && os[:release].to_i > 7)) do # rubocop:disable Layout/LineLength
208+
describe 'xtrabackup.sh', if: Gem::Version.new(mysql_version) < Gem::Version.new('5.7.0') && ((os[:family] == 'debian' && os[:release].to_i >= 9) || (os[:family] == 'ubuntu') || (os[:family] == 'redhat' && os[:release].to_i > 7)) do # rubocop:disable Layout/LineLength
209209
it 'runs xtrabackup.sh full backup with no errors' do
210210
run_shell('/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/xtrabackups/$(date +%F)_full --backup 2>&1 | tee /tmp/xtrabackup_full.log') do |r|
211211
expect(r.exit_code).to be_zero
@@ -250,7 +250,7 @@ class { 'mysql::server::backup':
250250
end
251251

252252
context 'with xtrabackup enabled and incremental backups disabled' do
253-
context 'should work with no errors', if: ((os[:family] == 'debian') || (os[:family] == 'ubuntu' && os[:release] =~ %r{^18\.04|^20\.04}) || (os[:family] == 'redhat' && os[:release].to_i > 7)) do
253+
context 'should work with no errors', if: ((os[:family] == 'debian') || (os[:family] == 'ubuntu') || (os[:family] == 'redhat' && os[:release].to_i > 7)) do
254254
pp = <<-MANIFEST
255255
class { 'mysql::server': root_password => 'password' }
256256
mysql::db { [

spec/acceptance/types/mysql_login_path_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
mysql_version = '8.0'
99
elsif os[:family] == 'debian' && os[:release] =~ %r{9|10|11}
1010
mysql_version = '8.0'
11-
elsif os[:family] == 'ubuntu' && os[:release] =~ %r{18\.04|20\.04}
11+
elsif os[:family] == 'ubuntu' && os[:release].to_f == 18.04
1212
mysql_version = '5.7'
1313
end
1414

0 commit comments

Comments
 (0)